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 |
|---|---|---|---|---|---|
5,874,774 | 5,874,775 | Interaction with google voice recognition in iPhone? Possible? | <p>Plz, go Through my Previous question?
<hr>
<a href="http://stackoverflow.com/questions/1240152/voice-recognition-in-iphone">http://stackoverflow.com/questions/1240152/voice-recognition-in-iphone</a>
<hr></p>
<p>Ok Now my Current question is as below.</p>
<p>It seems very hard to build my own voice recognition code - in iPhone.</p>
<p>Is it possible to use google's voice recognition in our software,</p>
<p>like when user wants to search a student by voice
=>voice is recorded & searched by google
=>& it respond to my application,</p>
<p>ok. I understand my question is quite confusing.
However plz leave comment for me for correction.</p>
<p>Thanks in advance for helping me out.</p>
| iphone | [8] |
2,244,452 | 2,244,453 | Parsing a string | <p>I want to parse a string to long the value is 1.0010412473392E+15.But it gives a exception input string was not in a correct format.how to do this.</p>
<p>Both these answers work how to select both of them as answer.</p>
| c# | [0] |
1,491,895 | 1,491,896 | How to set/create a Generics instance? | <p>I Have following problem:</p>
<pre><code>class Request<T>
{
private T sw;
public Request()
{
//How can i create here the instance like
sw = new T();
}
}
</code></pre>
<p>is it possible to do it?</p>
| c# | [0] |
5,415,199 | 5,415,200 | int _tmain(int argc, _TCHAR* argv[]) | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/895827/what-is-the-difference-between-tmain-and-main-in-c">What is the difference between _tmain() and main() in C++?</a> </p>
</blockquote>
<p>what is the difference between int _tmain(int argc, _TCHAR* argv[]) and int main(int argc, char** argv)?</p>
<p>I am not clear of the difference.</p>
| c++ | [6] |
5,197,740 | 5,197,741 | Preparedstatement java | <p>I want to look for something that matches a enum: Divisions:U6,U7,U8...
It works when i do this.</p>
<pre><code>public ArrayList<Training> zoekTrainingen(Ploegen p) throws
ApplicationException {
ArrayList<Training> tr = new ArrayList<>();
Connection conn = ConnectionManager.getConnection(driver,
dburl, login, paswoord);
try (PreparedStatement stmt = conn.prepareStatement(
"select * from trainingen");) {
stmt.execute();
ResultSet r = stmt.getResultSet();
while (r.next()) {
---
}
} catch (SQLException sqlEx) {
throw new ApplicationException("");
}
finally {
return tr;
}
}
}
</code></pre>
<p>but when I do this: </p>
<pre><code>try (PreparedStatement stmt = conn.prepareStatement(
"select * from trainingen where Divsion = ?");) {
stmt.setString(1, p.getDivision());
</code></pre>
<p>I get nothing</p>
| java | [1] |
2,093,478 | 2,093,479 | action after a delay | <p>I have a problem with this jquery script.</p>
<pre><code>toggle:function()
{
if(this.opened){
$("slideToBuyBottomBtnClosed").setStyle("display","block");
$("slideToBuyBottomBtnOpen").setStyle("display","none");
$("sildeToBuyContent").setStyle("overflow","hidden");
this.openOrCloseEffect.start({height:0});
this.opened=false
}else{
$("slideToBuyBottomBtnClosed").setStyle("display","none");
$("slideToBuyBottomBtnOpen").setStyle("display","block");
setTimeout($("sildeToBuyContent").setStyle("overflow","visible"), 1000);
this.openOrCloseEffect.start({height:182});
this.opened=true
}
}
</code></pre>
<p>I'm fighting with the <code>setTimeout</code> - I need to have this line:</p>
<pre><code>$("sildeToBuyContent").setStyle("overflow","visible");
</code></pre>
<p>started with a 1 second delay but I don't know if <code>setTimeout</code> is the right way.</p>
| jquery | [5] |
4,303,393 | 4,303,394 | Java - converting byte array of audio into integer array | <p>I need to pass audio data into a 3rd party system as a "16bit integer array" (from the limited documentation I have).</p>
<p>This is what I've tried so far (the system reads it in from the resulting bytes.dat file).</p>
<pre><code> AudioInputStream inputStream = AudioSystem.getAudioInputStream(new File("c:\\all.wav"));
int numBytes = inputStream.available();
byte[] buffer = new byte[numBytes];
inputStream.read(buffer, 0, numBytes);
BufferedWriter fileOut = new BufferedWriter(new FileWriter(new File("c:\\temp\\bytes.dat")));
ByteBuffer bb = ByteBuffer.wrap(buffer);
while (bb.remaining() > 1) {
short current = bb.getShort();
fileOut.write(String.valueOf(current));
fileOut.newLine();
}
</code></pre>
<p>This doesn't seem to work - the 3rd party system doesn't recognise it and I also can't import the file into Audacity as raw audio.</p>
<p>Is there anything obvious I'm doing wrong, or is there a better way to do it?</p>
<p>Extra info: the wave file is 16bit, 44100Hz, mono.</p>
| java | [1] |
5,019,443 | 5,019,444 | Python import scope issue | <p>I'm trying to do some script reuse for some python build scripts. An abbreviated version of my "reusable" part looks like (_build.py):</p>
<pre><code>Sources = []
Sources += glob('*.c')
Sources += glob('../FreeRTOS/*.c')
...
def addSources(directory, *rest):
for each in rest:
Sources += ['../'+directory+'/'+each+'.c']
def addSharedSources(*args):
addSources('Shared', *args)
</code></pre>
<p>Then in the customized part, I have something like (build.py):</p>
<pre><code>#!/usr/bin/env python
from _build import *
...
#Additional source files from ../Shared, FreeRTOS and *.c are already in
addSharedSources('ccpwrite', 'discovery', 'radioToo', 'telemetry', 'utility')
</code></pre>
<p>Unfortunately, when I try to run build.py, I get a traceback that looks like:</p>
<pre><code>Traceback (most recent call last):
File "./build.py", line 8, in <module>
addSharedSources('ccpwrite', 'discovery', 'radioToo', 'telemetry', 'utility')
File "/Users/travisg/Projects/treetoo/Twig/_build.py", line 49, in addSharedSources
addSources('Shared', *args)
File "/Users/travisg/Projects/treetoo/Twig/_build.py", line 46, in addSources
Sources += ['../'+directory+'/'+each+'.c']
UnboundLocalError: local variable 'Sources' referenced before assignment
</code></pre>
<p>So even though I did the wildcard import, it would appear that when the import function is called, it's not referencing my "global" variable imported from the original. Is there a way to make it work? I toyed around with <code>global</code>, but that didn't seem to do what I wanted.</p>
| python | [7] |
5,358,466 | 5,358,467 | How to find out rowindex when fire dropdown event inside gridview | <p>I am using two dropdownlist in gridview. Total 5 to 7 rows in gridview.
Bind ProductId and product name in First Dropdown. when select product that time databound in second dropdown.
so how to findout row number when fire dropdown's event.</p>
| asp.net | [9] |
827,887 | 827,888 | Problem with passing vector of pointers to objects to member function of another object | <p>I have a vector of pointers to Mouse objects called 'mice'.
I'm passing the mice to the cat by reference.</p>
<pre><code>vector <Mouse*> mice;
Cat * c;
c->lookForMouse(&mice);
</code></pre>
<p>And here's my lookForMouse() member function</p>
<pre><code>void Cat::lookForMouse(vector <Mouse*> *mice)
{
...
}
</code></pre>
<p>And now to the problem! Within the function above, I can't seem to access my mice. This below will not work</p>
<pre><code>mice[i]->isActive();
</code></pre>
<p>The error message I receive suggests to use mice[i].isActive(), but this throws an error saying isActive() is not a member of std::vector<_Ty> ...</p>
<p>This works though...</p>
<pre><code>vector <Mouse*> miceCopy = *mice;
miceCopy[i]->isActive();
</code></pre>
<p>I understand that I shouldn't be creating another vector of mice here, it defeats the whole point of passing it by reference (let me know if I'm wrong)...</p>
<p>Why can't I do mice[i]->isActive() What should I be doing?</p>
<p>Thanks for your time and help :D</p>
<p>James.</p>
| c++ | [6] |
1,441,881 | 1,441,882 | How to restart a guess number game | <p>I am using python 2.7.1</p>
<p>I would like to be able to restart the game based on user input, so would get the option of restarting, instead of just exit the game and open again.
Can someone help me figure out??Thanks</p>
<pre><code>import random
the_number = random.randrange(10)+1
tries = 0
valid = False
while valid == False:
guess = raw_input("\nTake a guess: ")
tries += 1
if guess.isdigit():
guess = int(guess)
if guess >= 1 and guess <= 10:
if guess < the_number:
print "Your guessed too low"
elif guess > the_number:
print "Your guessed too high"
elif tries <= 3 and guess == the_number:
print "\n\t\tCongratulations!"
print "You only took",tries,"tries!"
break
else:
print "\nYou guessed it! The number was", the_number,"\n"
print "you took",tries,"tries!"
break
else:
print "Sorry, only between number 1 to 10"
else:
print "Error,enter a numeric guess"
print "Only between number 1 to 10"
if tries == 3 and guess != the_number:
print "\nYou didn't guess the number in 3 tries, but you still can continue"
continue
while tries > 3 and guess != the_number:
q = raw_input("\nGive up??\t(yes/no)")
q = q.lower()
if (q != "yes") and (q != "no"):
print "Only yes or no"
continue
if q != "no":
print "The number is", the_number
valid = True
break
else:
break
</code></pre>
| python | [7] |
2,772,852 | 2,772,853 | c#× 288981Asp.net:Popup messages | <p>Explanation of my Project:
My project consists of 2 modules this is classified as per the user basis.i e.Administrator and user. which is developed in asp.net.
User module has 3 pages and administrator handles the database and requests send by the user.i.e 1:n 1 admin and n number of users using the web site.My Web application is used in the intranet. Now My requirement is when the user sends a request that should be shown as a alert or popup in the admins home page.If the administrator is not logged in at that time,i.e, when the request has been sent by the user. Then it should be stored in the inbox. When the administrator logs in with his credentials, He will be redirected to the home page.In that home page an alert window should be displayed at the right <em>bottom position of the page,That' U HAVE _</em> MESSAGES'. When he clicks ok button he will be redirected to the page where He will see all the list of messages just as we see in our GMAIL.
All these messages should be stored in the database. When the admin logs in they should get displayed in the Alert window as "U HAVE <em>_</em>_ Messages in your Inbox".
I know that it is not possible in doing .net.
To do this requirement Either Java script or Jquery should me used.
Please tell me any reference sites to refer this requirement.Or Please mention you have any Idea of doing this requirement.
Please help me .I will be grateful to you. Thanks in advance.</p>
| asp.net | [9] |
900,799 | 900,800 | Why I cannot compile source code on my phone? | <p>After I clicked run it shown as below</p>
<pre><code>[2011-02-23 22:12:06 - cas1] Uploading cas1.apk onto device '100082d63935'
[2011-02-23 22:12:15 - cas1] Failed to install cas1.apk on device '100082d63935': timeout
[2011-02-23 22:12:15 - cas1] Launch canceled!
</code></pre>
<p>Please help me solve this problem</p>
| android | [4] |
671,624 | 671,625 | Android Configurating UI Table View | <p>I have integrated the TableView from <a href="https://github.com/thiagolocatelli/android-uitableview" rel="nofollow">here</a> . The control is very well written, except for a problem that its wrap_content does not work. Either you have to hard code a height of it takes the full height of the parent. Has anyone dealt with this ? </p>
<p>Kind Regards,</p>
| android | [4] |
346,018 | 346,019 | Android user interface on xml | <p>Hello i am trying to create a android app and I need some help to start, i would like to know if there is some software which i can use to create all the buttons and other stuff connected with the user interface on xml .</p>
<p>thanks in advance.</p>
| android | [4] |
3,431,294 | 3,431,295 | Webview render issues | <p>I can't figure out the correct setting for a webview to make it fit width!
I've used in my HTML the viewport metatag with device-width option. In webview I've set WideViewPort and LoadWithOverviewMode to true. I've also tried to setInitialScale to 1.0.</p>
<p>All these seem to work in a few phones with android 1.6, 2.1, 2.2
However when I upgraded to 2.2.1 it doesn't work as wanted. I have an horizontal scrolling which I don't want! With a double-tap on the webview it fits, but not automatically when loaded.</p>
<p>Does anyone have any idea what Google changed in Android 2.2.1 webkit?</p>
| android | [4] |
3,374,449 | 3,374,450 | how to store iphone app's data even if it is uninstalled | <p>I have an app that has some consumable items, after they are used, user can do in-app purchase to get more.</p>
<p>How can avoid the user to unistall the app and reinstall so he doesn't have to pay?</p>
<p>Can i save some data that is going to remian regardless of if he unistalls it?</p>
<p>Should i have the app store in a database the udid of each device that it is installed in and when launched check that?</p>
<p>Thanks!</p>
| iphone | [8] |
4,990,603 | 4,990,604 | How to refer to an object name through a variable? | <p>I have some code that will open a sqllite database, get some street names, and populate a list box that is then attached to a combo-box so it can suggest the names as the user types them. I want to make a procedure that I can call to do this since it will be used on may different combo-boxes. I can pass it the name of the control, but how do I modify attributes of a contol while referring to it as a variable?</p>
<p>Something like:</p>
<pre><code>string A = "cbSTreets"
[A].text = "Sets the Text for the combo box."
</code></pre>
<p>If someone could just point me in the right direction I would appreciate it.</p>
| c# | [0] |
3,637,012 | 3,637,013 | how to add select option to datagrid control in asp.net | <pre><code><asp:DataGrid runat="Server" id="dg"></asp:DataGrid>
</code></pre>
| asp.net | [9] |
159,366 | 159,367 | how to find available system memory, disk space, cpu usage using system calls from java to windows OS | <p>how to find available system memory, disk space, cpu usage of windows OS using system calls from java?</p>
<p>*in windows operating system</p>
<p>wat i actually want to do is ,,, accept a file from client user and save the file in the server after checking the available space. my server and client are connected using a java tcp socket program!</p>
| java | [1] |
1,133,529 | 1,133,530 | How to find the inner text from xmlnodelist node = doc.getelementbytagname | <pre><code>XmlNodeList node = DOC.GetElementsByTagName("CheckMarkObject");
foreach (XmlNode nodes in node)
{
string name = null;
name = node.innertext;
}
checkmark.Label = node[0].InnerText;
checkmark.Name = node[0].InnerText;
//checkmark.IsChecked = form[0].InnerText;
CreateControlsUsingObjects(checkmark);
</code></pre>
| c# | [0] |
23,564 | 23,565 | Where to use Local inner classes | <p>Could you please explain me clearly "where do we need to use local inner classes"?</p>
<p>Example:</p>
<pre><code>public class LocalTest
{
int b=30;
void display()
{
class Local{
void msg()
{
System.out.println(b);
}
}
Local l = new Local();
l.msg();
}
public static void main(String args[])
{
LocalTest lt = new LocalTest();
lt.display();
}
}
</code></pre>
<p>Here <code>Local class</code> is a Local inner class. It is useful only for <code>display()</code>. In which type of situations do we use these local inner classes ?</p>
| java | [1] |
1,466,470 | 1,466,471 | How to call a javascript-delegate with parameters? | <p>Lets say I have a javascript function call moveItem which takes two parameters source and destination.</p>
<p>I want to assign this function the the click-event of several buttons, each having different source and destinations.</p>
<p>OK, so without the parameter I would do something like this:</p>
<pre><code>$('#myButton1').click(moveItem);
function moveItem() {
...
}
</code></pre>
<p>But what if moveItem looks like this:</p>
<pre><code>function moveItem(source, destination) {
...
}
</code></pre>
<p>this doesn't seem to work:</p>
<pre><code>$('#myButton1').click(moveItem('foo','bar'));
</code></pre>
| javascript | [3] |
4,805,096 | 4,805,097 | Is there a class that we can use to host both window form and controls? | <p>I am trying to build an application that has a container as the workspace. In this workspace, I can drag and drop windows form and controls. I have get the panel drag and drop working, but I can host window in it.</p>
<p>Please let me know if there is such a container class ready for use.</p>
<p>I am using visual studio 2008 and c#</p>
<p>Thanks</p>
| c# | [0] |
2,992,384 | 2,992,385 | nested for loop in python not working | <p>We basically have a large xcel file and what im trying to do is create a list that has the maximum and minimum values of each column. there are 13 columns which is why the while loop should stop once it hits 14. the problem is once the counter is increased it does not seem to iterate through the for loop once. Or more explicitly,the while loop only goes through the for loop once yet it does seem to loop in that it increases the counter by 1 and stops at 14. it should be noted that the rows in the input file are strings of numbers which is why I convert them to tuples and than check to see if the value in the given position is greater than the column_max or smaller than the column_min. if so I reassign either column_max or column_min.Once this is completed the column_max and column_min are appended to a list( l ) andthe counter,(position), is increased to repeat the next column. Any help will be appreciated.</p>
<pre><code>input_file = open('names.csv','r')
l= []
column_max = 0
column_min = 0
counter = 0
while counter<14:
for row in input_file:
row = row.strip()
row = row.split(',')
row = tuple(row)
if (float(row[counter]))>column_max:
column_max = float(row[counter])
elif (float(row[counter]))<column_min:
column_min = float(row[counter])
else:
column_min=column_min
column_max = column_max
l.append((column_max,column_min))
counter = counter + 1
</code></pre>
| python | [7] |
5,409,931 | 5,409,932 | load text property of label from datatable | <p>I want load the lsbel lbl agreed amount from a value from database
my code is</p>
<pre><code>public void Vehiclenocomboboxload()
{
OleDbConnection oleDbConnection1 = new System.Data.OleDb.OleDbConnection(connString);
oleDbConnection1.Open();
OleDbCommand oleDbCommand1 = new System.Data.OleDb.OleDbCommand("SELECT driverassignmastertable.drivername, driverassignmastertable.vehicleno, driverassignmastertable.amount, driverassignmastertable.driverpk FROM driverassignmastertable WHERE(((driverassignmastertable.jobcodepk)= @jobcodepk))", oleDbConnection1);
oleDbCommand1.Parameters.AddWithValue("@jobcodepk", cmbjobcode.SelectedValue);
OleDbDataReader reader = oleDbCommand1.ExecuteReader();
DataTable dt = new DataTable();
dt.Columns.Add("vehicleno", typeof(string));
dt.Columns.Add("drivername", typeof(string));
dt.Columns.Add("amount", typeof(int));
dt.Columns.Add("driverpk", typeof(int));
dt.Load(reader);
if (dt.Rows.Count == 0)
{
MessageBox.Show("No vehicle Assigned to this Jobcode");
cmbVehicleno.DataSource = null;
txtvehicleno.Text = "";
}
else
{
cmbVehicleno.ValueMember = "driverpk";
cmbVehicleno.DisplayMember = "vehicleno";
lblagreeamount.Text = "amount"
cmbVehicleno.DataSource = dt.DefaultView;
}
oleDbConnection1.Close();
}
</code></pre>
<p>all is fine but my problem is my lblagreed amount is not getting any value from database
my code part was
lblagreeamount.Text = "amount"</p>
<p>can anyone suggest any other databinding method</p>
| c# | [0] |
3,683,219 | 3,683,220 | Android APIs or Gaming Platform for 3d game | <p>I am going to develop 3d game in android. I just want to know what libraries should i use for 3d fighting game. Is there any gaming platform available in andriod which help me in 3d gaming development?</p>
| android | [4] |
4,155,969 | 4,155,970 | Why join() method returns different result than expected | <p>As mentioned in <a href="http://www.w3schools.com/jsref/jsref_join.asp" rel="nofollow">w3schools</a> join() method, joins all elements of an array into a string, and returns the string.
So if you try the following:</p>
<pre><code>console.log(new Array(6).join('a'));
</code></pre>
<p>I would expect to get: <code>"aaaaaa"</code>
but instead I get:<code>"aaaaa"</code>, that means one less.</p>
<p>Can someone explain me why is that happening?</p>
| javascript | [3] |
4,065,493 | 4,065,494 | network programming in python | <p>how do i run a python program that is received by a client from server without writing it into a new python file?</p>
| python | [7] |
1,356,126 | 1,356,127 | How to handle configuration change method in android? | <p>Please give me solution of handling on configuration change method. When i rotate portrait to landscape mode. </p>
| android | [4] |
1,891,058 | 1,891,059 | ASP.NET Dynamically filtering data | <p>For a project I'm working on, we're looking for a way to dynamically add filters to a page which then control the dataoutput in, for instance, a grid. We want to add the filters dynamically because we want the customer to be able to change which properties can be filtered and what filtertype (textbox, dropdown, colourpicker, etc.) should be used.</p>
<p>The filter should work as follows:
- The customer links a filter to a certain property and specifies the filtertype (for this example: dropdown).
- A user control which contains all the filter loads all filters specified
- The filters load all values of the specified property as options. The first time the page loads; this would be the values of all items.
- Now the user selects a value from one of the filters; the page reloads
- Only items which have the specified filter value are retrieved, the user may specify one or more filters at the same time.
- Once a user drills down by filtering, only filtervalues of the retrieved items should be used in the other filters.</p>
<p>I have the following problems:
- When I create the filters runtime, events are lost because the controls get recreated each postback.
- I could place the filters in PreInit which should solve this, but then determining which controls should be loaded becomes a problem since loading all environment vars isn't finished yet
- I don't know a good way of returning all the filter values to a central point from which I can make a good query.
- The query has to be dynamic. I'm using linq which I want to make dynamic so I don't have to select everything everytime. How to make a dynamic select query based on a string stored in the database?
- I have to select items based on the filtervalues and then adjust the rest of the filters to the already made selection. That kind of messes up the whole regular databinding sequence.</p>
<p>Any help in one of the above would be great!</p>
<p>PS: One thing I thought about was passing along filter values in the postback which would have to be recognizable. That way the server could use them for selection and then create the filters and autoselect the previously selected filtervalues. I'm not quite sure how to acheive this though...</p>
| asp.net | [9] |
5,816,850 | 5,816,851 | Making android default mail clients sender field not editable | <p>I am working on sending mail through android default mail client using mailIntent. For security reason I need to make sender field must not editable...</p>
<p>How can I achieve this?</p>
<p>Suggestions are welcome....</p>
| android | [4] |
5,929,460 | 5,929,461 | PHP DateTime() hours/minutes different but timestamp is the same | <p>I am trying to get a timestamp for both the current New York and London date/time.</p>
<pre><code>date_default_timezone_set('America/New_York');
$dtNY = new DateTime();
echo 'New York';
echo date('m-d-Y H:i:s', $dtNY->getTimestamp());
echo $dtNY->getTimestamp();
echo 'London';
date_default_timezone_set('Europe/London');
$dtLondon = new DateTime();
echo date('m-d-Y H:i:s', $dtLondon->getTimestamp());
echo $dtLondon->getTimestamp();
</code></pre>
<p>The result of above code is</p>
<p>New York
03-30-2012 08:32:49
1333110769 </p>
<p>London
03-30-2012 13:32:49
1333110769 </p>
<p>Why does above code give me totally identical timestamps but different dates?!? this is not logical :-s</p>
| php | [2] |
1,123,020 | 1,123,021 | variable seen by all classes Java | <p>I'm a beginner in java, so I don't know if there is any way to make a variable seen by all classes in same package?</p>
| java | [1] |
5,484,184 | 5,484,185 | Is it OK to use previous Handler in Activity created before onDestroy() onPause()? | <p>Is it OK to reuse a Handler object in the next life of Activity which was previously created in its previous session (before onPause, onDestroy()) ?</p>
<p>Like I create a Handler in Activity propagate it to other objects elsewhere, the Activity dies or pauses, then comes to life again and use the old handler ? </p>
<pre><code> // In the oncreate() method I have this code to recreate handler every time
// Then I set the handler to a static Global object
// Other Objects use the global object's static method to get
//fresh handler every timebefore calling sendMessage()
/**
* Set up handler
*/
Handler h = new Handler(new Callback()
{
public boolean handleMessage(Message msg)
{
handleServiceMessage(msg);
return true;
}
});
uiglobal = new UIGlobals(h);
</code></pre>
<p>UiGlobals is declared as </p>
<pre><code> private static UIGlobals uiglobal = null;
</code></pre>
<p>Not sure if the above approach is correct ..</p>
<p>my GlobalUI class looks like this</p>
<pre><code> public class UIGlobals
{
private static Handler handler = null;
public UIGlobals(Handler h)
{
handler = h;
}
public static Handler getHandler()
{
return handler;
}
}
</code></pre>
| android | [4] |
1,251,987 | 1,251,988 | java.lang.RuntimeException: Unable to resume activity Android | <p>I am trying to get the device bluetooth address so when ever I click on send </p>
<pre><code>startActivityForResult(new Intent(getApplicationContext(),
DeviceListActivity.class), GET_DEVICE_TO_SEND);
</code></pre>
<p>file via bluetooth the Discovery starts when its done I select one of founded devices</p>
<p>at the onActivityResult
I have these code</p>
<pre><code>if (requestCode == GET_DEVICE_TO_SEND && resultCode == RESULT_OK) {
String device = data
.getStringExtra(DeviceListActivity.DEVICE_ADDRESS);
String name = data.getStringExtra(DeviceListActivity.DEVICE_NAME);
</code></pre>
<p>the function onActivityResult is called and then the application stopp</p>
<p>The class: .MainUI is the one who hold the Tabhost </p>
<p>-</p>
<p>the class :FilesUI is where the function onActivityResult located
please help me Thanks :)</p>
<pre><code>03-19 18:39:28.858: E/AndroidRuntime(22817): java.lang.RuntimeException: Unable to resume activity {com.android.Connect/com.android.Connect.UI.MainUI}: java.lang.RuntimeException:`enter code here` Failure delivering result ResultInfo{who=Files, request=1, result=-1, data=Intent { (has extras) }} to activity {com.android.Connect/com.android.Connect.UI.MainUI}: java.lang.NullPointerException
</code></pre>
| android | [4] |
3,824,189 | 3,824,190 | Inline coding control's property | <p>IS it possilbe to inline code a porperty like Font-bold of control like linkbutton?</p>
<blockquote>
<p>Font-Bold="<%=(Display==1)?
true:false%>" </p>
</blockquote>
<p>this doesn't work.</p>
<blockquote>
<p>Cannot create an object of type
'System.Boolean' from its string
representation '<%=(Display==2)?
true:false%>' for the 'Bold'
property.</p>
</blockquote>
| asp.net | [9] |
5,527,002 | 5,527,003 | C++ array in structure access | <p>I have this structure in c++:</p>
<pre><code>struct Vertex_2 {
GLdouble position[3];
};
</code></pre>
<p>I am trying to access the array inside of it like this:</p>
<pre><code>Vertex_2.position[0] = //something;
Vertex_2.position[1] = //something;
....
...
..
</code></pre>
<p>when I compile it I get this:</p>
<pre><code>error: expected unqualified-id before ‘.’ token
</code></pre>
<p>why is that?</p>
| c++ | [6] |
3,024,330 | 3,024,331 | How to debug android application using android sdk? | <p>I am new to android application development, I am finding it difficult to debug my program I am always getting some abstract message like "your application stopped working" I need to know exactly. I have read there are many ways to debug. What I need to know is the way which will be easy for beginners like me.</p>
| android | [4] |
4,076,916 | 4,076,917 | increase the width | <p>how to increase the width of the line when mouse is moved where the line is drawn from canvas and its not an image and the line should increase or decrease gradually along with the mouse...
well i will explain in brief.i have created a div with a line drawn in it and once when the mouse is moved over the line and futher moved forward the line should move along with the mouse pointer so that the width of the line should gradually increase and decrease as the mouse moves</p>
<p>thx in advance</p>
| javascript | [3] |
3,394,761 | 3,394,762 | Connecting interrupts to table elements | <p>I'm having trouble <a href="http://jsfiddle.net/neAUZ/2/" rel="nofollow">here</a> connecting interrupts to table elements.</p>
<p>It seems that clicking "Delete cell" or "Open helper" should fire one of the handlers, but nothing happens. The Open helper td has two chances to fire a handler, once for the row it's in and once for the td it's in. </p>
<p>Does anyone see the problem?</p>
<p>Thanks.</p>
<p>The jsfiddle is perfectly clear but the forum wants code if there's a jsfiddle link, so here:</p>
<pre><code>$(document).on('click','tr.deleteCell', function(event) {
alert("deleting cell");
});
</code></pre>
| jquery | [5] |
1,773,411 | 1,773,412 | What is the flaw in this C++ code? | <p>(I am a beginner to C++. But I am familiar with some other prog. languages, specially with Java.)</p>
<p>Can anyone please help me to find the flaw in this C++ code?</p>
<pre><code>string & getFullName(string name, bool male){
string fullName = name;
if (male) {
fullName = string(” Mr. ”) + fullName;
return fullName;
}
}
</code></pre>
| c++ | [6] |
3,545,357 | 3,545,358 | PHP strtotime bug? | <p>Take a look at this code and please tell me how is it possible that this works flawlessly for Wednesday, but not for Tuesday:</p>
<pre><code> <?php
$current_time = strtotime('now');
if ($current_time > strtotime('tuesday this week 8:45pm') && $current_time < strtotime('tuesday this week 11:45pm')) {
$background = 1;
}
if ($current_time > strtotime('wednesday this week 8:45pm') && $current_time < strtotime('wednesday this week 11:45pm')) {
$background = 1;
}
else{
$background = 0;
}
?>
<script>
var backday = <?php echo json_encode($background); ?>;
</script>
</code></pre>
<p>For Tuesday, it returns 0, but for Wednesday it returns 1, as it should. WHY? </p>
| php | [2] |
4,079,349 | 4,079,350 | multi-select dropdown for categories and sub-categories | <p>HI,</p>
<p>I have a two multi-select dropdown list, one is for category and another for sub-category. When i select categories from dorpdown list, corresponding sub-categories should be listed in another multiselect dropdown list.</p>
<p>Please send me link where this sample is given.
Thanks</p>
| php | [2] |
5,327,737 | 5,327,738 | prevAll() TD in a table | <p>How can I count the total of TD elements before a specific TD ?</p>
<pre><code>var eq = $('td.input.current').prevAll('td.input').length;
</code></pre>
<p>eq is the position of the TD that have the class current but this position is relative to his containing TR, in other word prevAll() is only usefull for the TD brothers but not cousins =/</p>
| jquery | [5] |
5,713,876 | 5,713,877 | NSString stringWithContentsOfURL encoding Problem | <p>my app downloads and parses an xml file that contains German Umlauts (ä, ö, ü) and other special character (&, % etc). I seem to have a generall lack of understanding when it comes to encoding issues.</p>
<p>so what i do at the moment is:</p>
<ol>
<li>try to locate if i allready cached the xml file in my apps documents folder</li>
</ol>
<p>1.a if the file exists i load it into a string </p>
<pre><code>NSString * xmlData = [[NSString alloc] initWithContentsOfFile:filenameStr encoding:NSUTF8StringEncoding error:&error];
</code></pre>
<p>1.b if the file doesn't exist download its contents and save it afterwards</p>
<pre><code>NSString *xmlData = [NSString stringWithContentsOfURL:urlRequest encoding:NSUTF8StringEncoding error:&err];
[xmlData writeToFile: filenameStr atomically: FALSE encoding:NSUTF8StringEncoding error:&error]
</code></pre>
<ol>
<li>afterwards (the data is loaded now) i want to parse it...</li>
</ol>
<p>however, the contents of the xmlData is already "wrong" after stringWithContentsofURL returns (as i see it in the debugger). Also if i open the file that i saved into my documents folder, it's wrong too.</p>
<p>any advice, links, tips or best practices regarding encoding will be appreciated</p>
<p>thanks</p>
<p>sam</p>
| iphone | [8] |
4,476,158 | 4,476,159 | How to apply background-color css for jquery dialog | <p>I am forming some morel pop up at run time like below, but i want to apply the background color css how to apply it?</p>
<pre><code>$("<div></div>")
.addClass("dialog1")
.attr("id", $(this).attr("id"))
.appendTo("body")
// .addCss("background-color","red")
.dialog({
title: $(this).attr("data-dialog-title"),
close: function () { $(this).remove() },
width: $(this).attr("data-dialog-width"),
modal: true,
position: 'center',
resizable: $(this).attr("data-dialog-resizable")
}).load(url);
$(".close").live("click", function (e) {
e.preventDefault();
// $(this).dialog('destroy').remove();
$(this).closest(".dialog1").dialog("close");
});
</code></pre>
| jquery | [5] |
3,230,864 | 3,230,865 | Give variable name but not its value to a function | <p>To remove tedious code i would like to create a function to simplify it.<br>
So to change the settings that i stored in an object, I created this.</p>
<pre><code>var settings = {
color : 'red'
//one of many settings
};
alert(settings.color); // returns red
function changeValue(property, value){
settings.property = value;
}
changeValue('color', 'blue');
alert(settings.color); // still return red
</code></pre>
<p>it seems like its treated as a string instead.<br>
And if i try this: </p>
<pre><code>function changeValue(object, value){
object = value;
}
changeValue(settings.color, 'blue');
</code></pre>
<p>it would only give the function the value which is 'red'.<br>
and this:</p>
<pre><code>changeValue('settings.color', 'blue');
</code></pre>
<p>would not work obviously.</p>
<p>So how do i solve this ? How do i pass down a variable to a function but not its value so it can be altered ?</p>
<p>Note: the function is simplified for now, but would contain a lot more magic when it works.</p>
| javascript | [3] |
2,640,238 | 2,640,239 | remotely called java method - how to access a local variable | <p>i want to create an rmi server that can also act as a client, although this aspect works fine - a problem ive run into is that for any particular server/client relationship, changing a local variable on the instance acting (for the moment) as the server (and thus the method being triggered remotely) does not persist.</p>
<p>So next time i try to access this variable or return it, the original, unchanged variable comes through.</p>
<p>In C++ (if you had rmi :) i could have passed a pointer - but how can i force java to change the underlying value?</p>
| java | [1] |
1,640,787 | 1,640,788 | list out image extension support in android | <p>I would like to know that which <code>extension</code> of image are supported in android?
can you give me list of <code>image extension</code> support by android</p>
<p>Thanks
nik</p>
| android | [4] |
3,583,971 | 3,583,972 | How can I get the data about uninstall of a program? | <p>How can I get the data about uninstall of a program?
this is my code:</p>
<pre><code>private void uninstallSoftware()
{
Process p = new Process();
p.StartInfo.FileName = "msiexec.exe";
p.StartInfo.Arguments = "/x \"??????\"/qn";
p.Start();
</code></pre>
<p>}</p>
<p>For example:
I want to uninstall a Lan driver, the program currently displays in programs and features list.</p>
<p>How can I uninstall it from c# code?</p>
| c# | [0] |
955,557 | 955,558 | Label production using layout manager or null | <p>I have to create a label to be used for deliveries. At the moment because it is being pushed as needing a quick solution i am creating a JFrame putting all the components on then saving the contents as an image and disposing the frame so it flashes up for an instant and then vanishes, ready to print out. If I know the Label will always be X by Y would it be better to set the layout manager as null and place the components in the positions I need them or would it be better to use a layout manager? </p>
<p>I am currently using a flow layout manager and had to set the preffered size of the sender panel to be a bit larger so that it moved down to the next section (under the barcode). Is there a particular LayoutManager that would be good for this?</p>
<hr>
<p><img src="http://i45.tinypic.com/2agvrz6.png" alt="Target Layout"></p>
<p><strong>^^^ The above is the target Layout ^^^</strong></p>
<hr>
<p><strong>vvv Below is what I have currently achieved vvv</strong></p>
<p><img src="http://i47.tinypic.com/ak8t1w.png" alt="current Layout"></p>
<hr>
<p><strong>^^^ Currently achived Layout ^^^</strong></p>
<p>Also is there an easy way to draw lines like in the first picture?</p>
| java | [1] |
1,054,277 | 1,054,278 | Pointers assignment | <p>What is the meaning of </p>
<pre><code>*(int *)0 = 0;
</code></pre>
<p>It does compile successfully</p>
| c++ | [6] |
1,850,956 | 1,850,957 | How can I make this method more general? | <p>I have this method called LoadToDictionary. It accepts a dictionary and a filepath. Currently, it would look something like this:
<code>void LoadToDictionary(Dictionary<string, string> dict, string filePath</code>. Then inside, it would have a lot of code to extract the contents of the file in filePath to a dictionary. I want to make it more general, so it could, say, take a dictionary with int's instead, and the ability to change the parsing code in the method. Should I mark this method and later override it? Is there any other way?</p>
| c# | [0] |
2,553,814 | 2,553,815 | How to handle call to __setattr__ from __init__? | <p>I have written a class that will be used to store parameters in a convenient way for pickling. It overloads <code>__setattr__</code> for convenient access. It also uses a list to remember the order in which attributes where added, so that the iteration order is predictable and constant. Here it is:</p>
<pre><code>class Parameters(object):
def __init__(self):
self._paramOrder = []
def __setattr__(self, name, value):
self._paramOrder.append(name)
object.__setattr__(self, name, value)
def __delattr__(self, name):
self._paramOrder.remove(name)
object.__delattr__(self, name)
def __iter__(self):
for name in self._paramOrder:
yield self.name
def iteritems(self):
for name in self._paramOrder:
yield name, self.name
</code></pre>
<p>The problem is that <code>__init__</code> calls my overloaded <code>__setattr__</code> in order to add the <code>_paramOrder</code> to the instance dictionary. Is there a way to handle this without adding a special case to <code>__setattr__</code>?</p>
| python | [7] |
4,129,265 | 4,129,266 | Hotmail account password changer script | <p>I need to write a php script that does the following:</p>
<p>Log into hotmail; change password; setup mail forwarding. I was wondering if that is even possible, since I can't find anything about it online.</p>
<p>I'm only a beginner, so please help me out here. I'm not asking you to write the program for me, I just need to know whether it can be done at all.</p>
| php | [2] |
3,205,722 | 3,205,723 | Android Dev: icon in notification bar | <p>I see some apps which place an icon in the notification bar on my device. how do i do that with my app ?</p>
| android | [4] |
5,715,451 | 5,715,452 | Jquery striped rows | <p>Ive got this script:</p>
<pre><code>$(function(){
$(".submenu li:even").addClass("oddrow");
});
</code></pre>
<p>It works great - but it continues to stripe through all the submenus...</p>
<p>How do i contain it, so it starts again at the start of each submenu</p>
| jquery | [5] |
169,208 | 169,209 | how to render 3D surfaces in Python | <p>I currently have a working python code which generates a 2D animation of a colormap, in the shape of a circle. This colormap is meant to represent the activation levels of the heart.<br>
The next step is to take this 2D colormap and generate a 3D surface.
I would like to know what is the best and simplest way to do this in Python (keep in mind that the solution would have to be a free solution). I have worked with Matplotlib and taken a look at the 3D surface rendering, however I find that it is not up to par, and thus I am looking for another solution.
Any help would be appreciated</p>
| python | [7] |
55,684 | 55,685 | Error with on click view | <p>In my app i need to show dialogs for a lot of buttons. Therefore i decided to use 1 onClick for a series of buttons. Only the first line where we implement, there is an error. My code is as follows:</p>
<pre><code>import android.app.Activity;
import android.os.Bundle;
import android.app.AlertDialog;
import android.view.View;
public class Trial extends Activity implements View.OnClickListener {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
View b1 = findViewById(R.id.button1);
b1.setOnClickListener(this);
View b2 = findViewById(R.id.button2);
b1.setOnClickListener(this);
}
View.OnClickListener yourListener = new View.OnClickListener() {
public void onClick(View v) {
if (v == button1) {
new AlertDialog.Builder(v.getContext())
.setTitle("Paracettamol")
.setMessage(
"This medicine is generally used to cure Fever")
.setNeutralButton("OK", null).show();
} else if (v == button2) {
new AlertDialog.Builder(v.getContext())
.setTitle("sertraline")
.setMessage(
"This medicine is generally used to cure Head aches")
.setNeutralButton("OK", null).show();
}
}
}
</code></pre>
<p>The fifth line(public class Trial extends Activity implements View.OnClickListener ) gives an error as follows:The type trial must implement the inherited abstract method View.OnClickListener.onClick(View). can anyone please help me.</p>
| android | [4] |
4,891,455 | 4,891,456 | how to get log in ISA server 2006 C++ SDK without memory leak | <p>i wrote a method that get the all session log info with isa server 2006 SDK</p>
<p>the main code is below and i have to use this code in do-while() to get all sessions information but this line make leak memory . </p>
<p>at the end i released the pointer of FPCLib::IFPCLogEntryptr but mem leak is still exist .
:(
could you please help me this problem .</p>
<pre><code>FPCLib::IFPCLogEntryptr = FPCLib::IFPCLogContentPtr::Item(index)
.
. // reading informationsuch as ip, url , byte send , ....
.
FPCLib::IFPCLogEntryptr.release();
hr = LOGFilter.CreateInstance("FPC.FPCFilterExpressions");
hr = LOGFilter->put_FilterType(FPCLib::FpcFilterType::fpcNoFilterType);
FPClogviewer = FPCArray->LogViewer;
LOGContent = FPClogviewer->GetLogContentOnline();
LOGContent->ExecuteQuery(LOGFilter,EXECUTEROWCOUNT);
FPCLib::IFPCLogEntryPtr FPCLogEntry;
_bstr_t ClientIP;
int index= 0;
do
{
index ++ ;
FPCLogEntry = LOGContent->Item(_variant_t(index));
ClientIP = FPCLogEntry->ClientIP;
FPCLogEntry.Release();
}
while (1)
</code></pre>
| c++ | [6] |
2,774,324 | 2,774,325 | Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')'? | <p>After adding this code:</p>
<pre><code>if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == "edit_q_ask_question") {
// Do some minor form validation and make sure there is content
$nonce=$_REQUEST['nonce'];
if (! wp_verify_nonce($nonce, 'edit_q_question_form') ) die('Security check');
if (isset ($_POST['title'])) {
$title = $_POST['title'];
} else {
echo 'Please enter a title';
}
if (isset ($_POST['question'])) {
$question = $_POST['question'];
} else {
echo 'Please enter some content';
}
$new_question = array(
'post_title' => $title,
'post_content' => $question,
'post_category' => array($_POST['category'])
'ID' => $_POST['q_to_update'];
);
// Update the post into the database
$new_id = wp_update_post( $new_question );
echo 'Qestion updated and you can see it <a href="'.get_permalink($new_id).'">here</a>';
}
</code></pre>
<p>I get this:</p>
<blockquote>
<p>Parse error: syntax error, unexpected
T_CONSTANT_ENCAPSED_STRING, expecting
')' in
/home/alex/www/qaf/wp-content/themes/twentyten/edit-question.php
on line 34</p>
</blockquote>
<p>Any suggestions?</p>
| php | [2] |
995,692 | 995,693 | How to implement actionsheet in Android | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/6342180/implement-actionsheet-in-android">implement actionsheet in android</a> </p>
</blockquote>
<p>I am trying to implement the action sheet in Android. This feature is not present and I'm wondering, if anyone has come across this feature? I would appreciate any advice.</p>
| android | [4] |
1,024,286 | 1,024,287 | capture all frame send to display of the phone | <p>I would like to capture all the output (frame) send to display of the phone? (I would like to do mirroring- send the display over Wi-Fi)</p>
<p>Should I do it in NDK layer or using android API?</p>
<p>Is there an example or tutorial I can use</p>
| android | [4] |
1,516,042 | 1,516,043 | Android: How to detect if an Activity goes into the background? | <p>I need a way for my Activity to known that it's going into the background, and not when it's getting killed. I thought about hooking at onStop(), but onStop() is called for both cases. In other words, is there a way to tell if when my Activity is moving into the background and not getting killed?</p>
| android | [4] |
5,626,568 | 5,626,569 | Periodicity of events 2 | <p>My previous question got a lot cons. I will try again, with a code and why it not work.</p>
<p>For example, we have event that will go every 3 month. Event have DateStart, DataEnd and Periodicity.<br>
For example, we have a record:</p>
<pre><code>start = 02/23/2012 22:00:00;
end = 12/31/2012 23:30:00;
periodicity = 3;
</code></pre>
<p>Method must return true when current month = February, May, August, November.</p>
<p>Code:</p>
<pre><code>public bool MonthPeriodicityChecker (DateTime start, DateTime end, DateTime dateToCheck, int periodicity)
{
var monthDiff = dateToCheck.Month - startDate.Month;
return (monthDiff-1) % periodicity == 0;
}
</code></pre>
<p>This code return <code>true</code> if month in dateToCheck equals April, July, October. It's skip first month.</p>
<p><strong>UPDATE:</strong></p>
<p>Damn, sorry to all. In the beyond, I have loop that sumulated dates. And this loop start with 1 and add this 1 to <code>start</code>. And next date was 24 February. Therefore, the February not prints( there are checks for number(23) of month too) in my program. Sorry and thanks.</p>
| c# | [0] |
2,848,195 | 2,848,196 | Check the authenticity of given link and store it in a mysql table using php | <p>How to check if the user given link is a link belonging to a particular website or not? I am using php. Should I use preg or is there a function for it? Can i also check if the link is broken or not? Is there a function for it? How can i make sure to delete malacious links or is it not possible to handle it automatically? Should i us the following function?
<code>$link=mysql_real_escape_string($_GET['link']);</code></p>
| php | [2] |
4,541,799 | 4,541,800 | ITemplate, the reason for leaving InstantiateIn(Control container) | <p>I'm implementing the <code>ITemplate</code> interface in <code>ListView</code> control. If i realize it for <code>ItemTemplate</code> in my custom class, everything will be OK. I mean, the runtime will invoke InstantiateIn when i use </p>
<pre><code>ListView.ItemTemplate = new CustomClass();
CustomClass :ITemplate
{
public void InstantiateIn(Control container)
{
HtmlTable table = CreateHeader();
container.Controls.Add(table);
}
...
}
</code></pre>
<p>But i want to do the same with <code>ListView.LayoutTemplate</code>. In this case, the runtime invokes InstantiateIn only one time, but every next update it leaves my method. What is the reason for it?</p>
| asp.net | [9] |
6,007,178 | 6,007,179 | posix timer_create() function causing memory leak on linux | <p>I am using timer_create function for timer functionality in my application.
When timeout happens, a new thread gets created. That time my application's memory usage is getting increased by around 11mb. I also have set the thread attribute to PTHREAD_CREATE_DETACHED. Any help is appreciated. I also want to know how long will the thread that gets created when timeout happens be alive?</p>
| c++ | [6] |
4,073,618 | 4,073,619 | iPhone SDK 3.1.2 - Only Bugfix? | <p>Apple just released iPhone SDK 3.1.2. </p>
<p>I was wondering wether they changed some libraries or fixed only bugs.</p>
<p>Can someone give me some insight? </p>
| iphone | [8] |
132,647 | 132,648 | pinterest sorcery | <p>maybe it's some kind of default behavior that I'm ignoring,
but at the moment I haven't the slightest idea of how once you click an element on the homepage of <a href="http://pinterest.com" rel="nofollow">http://pinterest.com</a> the url actually changes ie: <a href="http://pinterest.com/pin/60165344991931565/" rel="nofollow">http://pinterest.com/pin/60165344991931565/</a> </p>
<p>At the same time the page is not changed!
It just loads ajax content and injects the result inside the html. </p>
<p>I never saw a behavior such as this. I'm using latest Chrome.</p>
| javascript | [3] |
5,081,027 | 5,081,028 | how to display text on list view when click on the list view in android | <p>i have list view which is generated from adapter it contain two images one when it is in normal form and one when the list view is click. my problem is that when click on list view the image will change but the text written on list view in normal form will not display on new image please help.
thanks</p>
| android | [4] |
1,319,996 | 1,319,997 | Insert and Edit Template show in Devexpress in aspxGridview | <p>In Insert Mode I want to show one kind of Template and Edit Mode I want to show another Kind of Template in Devexpress Control in C#.NET</p>
| c# | [0] |
1,067,711 | 1,067,712 | How to get domain ip address using domain name in C++? | <p>i am using visual c++,</p>
<p>I want to get a domain ip address from domain name..
how do i get it..
i already tried gethostbyname function...
here my code...</p>
<pre><code> HOSTENT* remoteHost;
IN_ADDR addr;
hostName = "domainname.com";
printf("Calling gethostbyname with %s\n", hostName);
remoteHost =gethostbyname(hostName);
memcpy(&addr.S_un.S_addr, remoteHost->h_addr, remoteHost->h_length);
printf("The IP address is: %s\n", inet_ntoa(addr));
</code></pre>
<p>But i get a wrong ip address.</p>
| c++ | [6] |
3,077,456 | 3,077,457 | mysql strange characters iphone and safari | <p> hello </p>
<p>Some messages (like the one above) are saved in my mysql database and then when i retrieve the data yellow hearts are shown at the start and the end of the message in the mobile iphone safari browser!</p>
<p>Why is this happening? Anyone knows?</p>
| iphone | [8] |
3,535,930 | 3,535,931 | Navigation bar common to all activities | <p>I have been looking for options on how to place <strong>Navigation bar</strong> common to all activities. Still can't figure out the best way to do it. The Navigation bar should have a title for screen and a back button. Or may be two in some activities.<br>
What is the best practice I should follow?</p>
<p>Thanks</p>
| android | [4] |
163,904 | 163,905 | Inputing as array in textbox group | <p>I have created a textbox group using JavaScript i.e. on clicking Add button new set of textboxes will be added to the page.</p>
<pre><code>var newTextBoxDiv = $(document.createElement('div'))
.attr("id", 'TextBoxDiv' + counter);
newTextBoxDiv.after().html('<label>Track #'+ counter + ' : </label>' +
'<input type="text" name="textbox1[]' + counter + '" value="" >' +
'<input type="text" name="textbox2[]' + counter + '" value="" >' );
newTextBoxDiv.appendTo("#TextBoxesGroup");
</code></pre>
<p>DIV class for my PHP page is..</p>
<pre><code> <div id='TextBoxesGroup'> <div id="TextBoxDiv1"> <label>Track #1 : </label>
<input name="textbox1[]" type='textbox' ><input name="textbox2[]" type='textbox'>
</div>
</div>
</code></pre>
<p>Now I want to create an array so that, easily input values of this set of text boxes to database. Instead of using multidimensional array, I want to use single array so values of set of <code>textbox1#</code> stores as key for array and values of set of <code>textbox2#</code> stores as corresponding values for array.</p>
| php | [2] |
4,666,901 | 4,666,902 | declaring css properties in a css file for jquery .animate() | <p>While implementing jquery <code>.animate()</code>, I've to write like</p>
<pre><code>$('#clickme').click(function() {
$('#book').animate({
width: '200px',
height: '500px'
})
})
</code></pre>
<p>Isn't there some way to write the css properties in a css file and just do the 'animate' by including the css property??</p>
<p>Something like</p>
<pre><code>.move{
width: '200px',
height: '500px'
}
</code></pre>
<p>Then</p>
<pre><code>$('#book').animate({
// include the .move css class somehow
})
</code></pre>
<p>I tried using <code>$( "#effect" ).addClass( "newClass", 1000 );</code> but there is no animation, the properties just seem to be assigned after the duration declared!!</p>
| jquery | [5] |
2,711,183 | 2,711,184 | Python dictionary to store socket objects | <p>Can we store socket objects in a Python dictionary.
I want to create a socket, store socket object, do some stuff and then read from the socket(search from dictionary to get socketobject).</p>
| python | [7] |
5,911,966 | 5,911,967 | Updating an object's definition in javascript | <p>I'm fairly new to object orientated stuff so this may very well be the wrong way to be going about getting this done.</p>
<p>This is a very slimmed down version of what I currently have, but the concept is essentially the same. When the user clicks on a canvas element on my page, I create 20 instances of the particle object below, append them to an array whilst at the same time updating the canvas at 30FPS and drawing circles based on the x property of the instances of each object. Once a particle is off the screen, it's removed from the array.</p>
<pre><code>var particle = function()
{
var _this = this;
this.velocity = 1;
this.x = 0;
this.updateVelocity = function(newVelocity)
{
_this.multiplier = newVelocity;
}
var updateObject = function()
{
_this.x += velocity;
}
}
</code></pre>
<p>I would like the user to be able to control the velocity of new particles that are created using an input element on the page. When this is updated I have an event listener call</p>
<pre><code>particle.updateVelocity(whateverTheUserEntered);
</code></pre>
<p>However I get the error "particle has no method updateVelocity". After a bit of reading up on the subject I understand that to call that function I need to create an instance of the object, but this will only update the velocity value of that instance which isn't going to work for me.</p>
<p>My question is, is there a way to achieve what I'm doing or have I approached this in completely the wrong way? As I said, I'm still getting to grips with OOP principles so I may have just answered my own question...</p>
| javascript | [3] |
5,470,277 | 5,470,278 | PHP: literal \n rather than new line | <p>I have a php var which, when echoed, writes a JS function into the source of a page. The function loops through a CSV and so it has the following line within it:</p>
<pre><code>$str="var lines = data.split('\n');";
</code></pre>
<p>At the present time, when echoed, I get this 'correct' JS written into the source:</p>
<pre><code>var lines = data.split('
');
</code></pre>
<p>Instead, I want to echo the literal string <code>\n</code> into the source of the page.</p>
<p>Can anyone point me in the right direction? Thanks.</p>
| php | [2] |
3,171,033 | 3,171,034 | iPhone SearchBar with Buttons Underneath? | <p>How would one implement a search field like the one used on the iPhone Mail application. When you attempt to search it shows up 4 buttons under the search bar with the fields you can search. The search bar actually moves up to cover the navigation bar and exposes those buttons.</p>
<p>I'd like to do something similar in my application where you can specify what exactly you are searching for. I think the mail search is a little difference since it also has a cancel button?</p>
<p>How would you accomplish this and what components would you use?</p>
| iphone | [8] |
4,133,462 | 4,133,463 | Is there any wordpress plugin to upload images and captions to multiple pages once | <p>Hi I have a couple of pages that need the same images and captions, is there a wordpress plugin that would allow this on 1 upload?</p>
| php | [2] |
3,232,758 | 3,232,759 | What does Layout Inflater in Android do? | <p>What is the use of <a href="http://developer.android.com/reference/android/view/LayoutInflater.html" rel="nofollow"><code>LayoutInflater</code></a> in Android?</p>
| android | [4] |
1,530,275 | 1,530,276 | Eclipe for php how to know how many called of my function. e.g foo(). i want to know where called foo() and file locatioin | <p>I am using eclipe for PHP, I could use ctrl+click jump to any function located file.
Opposite above, does any trick if i want to know e.g. foo() in file foo.php how many called? which php file called foo() to use?</p>
<p>I can use "search" but result will be messy if the same function name located many php file.</p>
| php | [2] |
3,281,683 | 3,281,684 | How to set the image for imageview from library wheen we click on imageview? | <p>I am developing an application.In that I want to set the image for imageview.So when iam click on imageview,in that time only library will be open.For that i use the below method.But library will be opened at every click at every where.</p>
<pre><code>-(void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event.
</code></pre>
<p>But i want to open the library when iam click on imageview only.Please tell me how to solve this one.</p>
| iphone | [8] |
5,197,334 | 5,197,335 | duplicate canvas in a smaller size | <p>For some reason my android game is drawing two images when i only stated for one to be drawn.</p>
| java | [1] |
2,856,761 | 2,856,762 | selectable dialogbox | <p>open message box and long click on a message , as you can see , a new dialog box will be shown with some selectable items like View Contact and Delete Thread , how can I make a dilogbox like it , so when I can put some items and make some events for each one .</p>
<p>thanks</p>
| android | [4] |
636,141 | 636,142 | superscript in asp label | <p>i wish to display a single label as "18th january 2011"... where 'th' hs to be in superscript.. how to do in asp.net with label?? </p>
| asp.net | [9] |
5,238,433 | 5,238,434 | vanilla JavaScript set style on body | <p>Why does this not work?</p>
<p>Using vanilla JavaScript to set the style on body tag?</p>
<pre><code><html>
<body style="display:none;">
test
</body>
<script>
document.getElementsByTagName("body").style.display = "block";
</script>
</html>
</code></pre>
| javascript | [3] |
1,731,307 | 1,731,308 | PHP - $_FILES issues | <p>I have the following on a PHP processing file.</p>
<pre><code>if(isset($_FILES['cv'])){
// run function here
}
</code></pre>
<p>Only problem is that the function is getting all the time ... Shouldnt it only be run if a file has been input?</p>
| php | [2] |
3,211,194 | 3,211,195 | Secure connection in android | <p>In my android application i would like to use secure connection from client to server.Could anyone please suggest as how i can do it in android?</p>
<p>Please forward your valuable suggestions.</p>
<p>Thanks in advance :)</p>
| android | [4] |
2,852,219 | 2,852,220 | How to make tablet click on textbox to open keyboard with Numbers Not letters? | <p>When i click on textbox that is password txtbox i want to see Numbers not letters and then to swich to Numbers keyboar.Any one know how to do this?</p>
| asp.net | [9] |
975,873 | 975,874 | I want to read data form a sequential textfile and write it to a binary file | <p>Hi guys i'd like you to help me with how to write data to a binary file that is from a textfile, i just know how to write or from each separately but not exchange data between the two. Please halp, thanks in advance</p>
| c++ | [6] |
4,179,214 | 4,179,215 | How do I set relative paths in PHP? | <p>I have an absolute path of (verified working)</p>
<pre><code> $target_path = "F:/xampplite/htdocs/host_name/p/$email.$ext";
</code></pre>
<p>for use in </p>
<pre><code>move_uploaded_file($_FILES['ufile']['tmp_name'], $target_path
</code></pre>
<p>However when I move to a production server I need a relative path:</p>
| php | [2] |
3,916,298 | 3,916,299 | filter datatable on loop | <p>Is there anyway of filtering datatable based on other datatable. something like below:</p>
<pre><code> foreach (datarow dr in somedatatable.select("id= someothertable.rows["someotherid"])
{
dr[somefield]=someothertable[someotherfield];
}
</code></pre>
| c# | [0] |
1,286,122 | 1,286,123 | Start BroadCastReceiver From Activity | <p>I want to Start Broadcastreceiver form an Activity. How can i do that?</p>
| android | [4] |
364,658 | 364,659 | Create subsets of Item objects | <p>hey guys i have class Item which i use to create Item objects</p>
<pre><code> public class Item {
private String id;
private int count;
private String name;
public int getcount()
{
return this.count;
}
public Item(String name)
{
this.name=name;
this.id = "";
}
public Item(String id, String name)
{
this.name=name;
this.id=id;
}
public Item(int count)
{
this.count=count;
}
public String getItemName()
{
return this.name;
}
public String getItemId()
{
return this.id;
}
public Item returnItems(ItemList itemset)
{
Item item=null;
return item;
}
}
</code></pre>
<p>And i have ItemList class that stores List of items. Here am adding List of item objects </p>
<pre><code>public class ItemList implements Iterable<Item>
{
private List<Item> hold=new ArrayList<Item>();
ItemList(Item item)
{
this.hold.add(item);
}
ItemList() {
//throw new UnsupportedOperationException("Not yet implemented");
}
public List<Item> getItemSet()
{
return this.hold;
}
public void addItems(Item item)
{
//hold = new ArrayList<Item>();
this.hold.add(item);
}
@Override
public Iterator<Item> iterator() {
Iterator<Item> item = hold.iterator();
return item;
}
}
</code></pre>
<p>Supose initailly i add I1,I2,I3 item obects to Itemlist as follows</p>
<pre><code> {I1}
{I2}
{I3}
</code></pre>
<p>now i want to create a subsets of Item objects as follows and add to ItemList where each subset will contain 2 Items</p>
<pre><code> {I1 I2}
{I1 I3}
{I2 I3}
</code></pre>
<p>Please help in creating a subset
Later i even want have subsets of 2 Items or more
I want to write a function that will help me to create subsets of n items
Please help</p>
| java | [1] |
5,102,143 | 5,102,144 | Add included PHP function to a class? | <p>I have many different PHP-files. Because it is a Wordpress theme I need to include all my functions into a class to avoid collisions.</p>
<p>What I want is having the theme name as a "prefix" (first part of the class name). <strong>Is it possible to use the same class for all functions even if they are in different PHP files?</strong></p>
<p><strong>This is how it might look:</strong></p>
<pre><code>myfunctions.php
myfunctions_extra.php
</code></pre>
<p>"myfunctions.php" includes a function <code>test</code> that is added to <code>class my_class</code>.</p>
<p>"myfunctions_extra.php" includes a function <code>test2</code> that should be added to <code>class my_class</code> as well.</p>
<p>Is it possible? How?</p>
| php | [2] |
4,841,584 | 4,841,585 | jQuery: adding event handler to just created element | <p>I have a statement adding a new div:</p>
<pre><code>$('#dates').append('<div class="'+classname+'">'+dd+'<br /><span class="month_selector">'+dm+'</span></div>');
</code></pre>
<p>But I'd like to not only create element but also to assign on('click') action to it.
Of course I could add generated id and then acces to created element by this id, but I feel that there is more beautiful solution.</p>
<p>Is it?</p>
| jquery | [5] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.