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,848,349 | 5,848,350 | Static Method call from unknown object | <p>I want to call a static method from one of my objects. This is no problem if I know the name of the object, but in this case, I don't.<br>
I have an array with several object names and I want to call the method from one of this arrays elements. So, it looks something like this:</p>
<pre><code>function call_method($key) {
$tmp = array('key1' => 'objectname1','key2' => 'objectname2','key3' => 'objectname3');
if(array_key_exists($key, $tmp)) {
$tmp::static_method();
}
}
</code></pre>
<p>But, this solution is not working. Does somebody know how to get this working?</p>
| php | [2] |
610,010 | 610,011 | PHP - sort associative array by another indexed array | <p>I have the following arrays:</p>
<pre><code>$arr = array(
'keyA' => 'valueA',
'keyB' => 'valueB',
'keyC' => 'valueC',
'keyD' => 'valueD'
);
$order = array('3', '4', '1', '2');
</code></pre>
<p>I need to sort $arr based on $order so the output be </p>
<pre><code>array(
'keyC' => 'valueC',
'keyD' => 'valueD',
'keyA' => 'valueA',
'keyB' => 'valueB'
</code></pre>
<p>);</p>
<p>Can someone help me?</p>
<p>Thanks.</p>
| php | [2] |
3,269,178 | 3,269,179 | Get the ID of a record in a gridview asp.net | <p>i have a checkbox in a template field of a gridview and i want to get the id of the record at a checkbox tick. how do i do it? i am doing asp.net and also by using datakeynames instead, my gridview also shows the datakeynames persID column. why? </p>
<p>my code: </p>
<pre><code><asp:GridView ID="GridViewHostelMember" runat="server" DataKeyNames="_PersID" AutoGenerateColumns="false">
<Columns>
<asp:BoundField DataField="_PersID" HeaderText="_PersID" />
<asp:BoundField DataField="FirstName" HeaderText="First Name" />
<asp:BoundField DataField="LastName" HeaderText="LastName" />
<asp:BoundField DataField="DOB" HeaderText="DOB" />
<asp:BoundField DataField="FatherName" HeaderText="FatherName" />
<asp:BoundField DataField="Type" HeaderText="Type" />
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="CheckBoxSelect" runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
protected void Button1_Click(object sender, EventArgs e)
{
foreach (GridViewRow item in this.GridViewHostelMember.Rows)
{
CheckBox chbTemp = item.FindControl("CheckBoxSelect") as CheckBox;
if (chbTemp != null)
{
if (chbTemp.Checked)
{
Label1.Text = item.Cells[0].Text;
}
}
}
}
</code></pre>
| asp.net | [9] |
238,029 | 238,030 | ifstream how to determine why file does not open? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/839644/get-stdfstream-failure-error-messages-and-or-exceptions">Get std::fstream failure error messages and/or exceptions</a> </p>
</blockquote>
<p>I am using <code>ifstream</code> and I need to make opening of file very robust. </p>
<pre><code>std::ifstream myfilestream(fileName);
if (!(myfilestream.is_open())){ // if not open how do I determine cause?
}
</code></pre>
<p><a href="http://www.cplusplus.com/reference/iostream/ifstream/" rel="nofollow">http://www.cplusplus.com/reference/iostream/ifstream/</a></p>
<p>Thanks</p>
| c++ | [6] |
2,787,127 | 2,787,128 | detect gps disabled | <p>I have this code to get my GPS position:</p>
<pre><code> public void run() {
mLocationManager = (LocationManager)context.getSystemService(Context.LOCATION_SERVICE);
if (mLocationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
Looper.prepare();
mLocationListener = new MyLocationListener();
mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, mLocationListener);
Looper.loop();
Looper.myLooper().quit();
} else {
//Never be here!!!
}
}
private Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
pd.dismiss();
mLocationManager.removeUpdates(mLocationListener);
if (currentLocation!=null) {
//found. OK
}
}
};
private class MyLocationListener implements LocationListener {
@Override
public void onLocationChanged(Location loc) {
if (loc != null) {
setCurrentLocation(loc);
handler.sendEmptyMessage(0);
}
}
@Override
public void onProviderDisabled(String provider) {
//If I disable de GPS I have an error
}
@Override
public void onProviderEnabled(String provider) {
// TODO Auto-generated method stub
}
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
// TODO Auto-generated method stub
}
}
</code></pre>
<p>how can I detect the GPS disabled and too time looking for data?</p>
<p>I thought that onProviderDisabled detect that event, but, my code never go there. I got this exception:</p>
<p>Cant create handler inside thread that has not called Looper.prepare</p>
<p>Thank you in advance</p>
| android | [4] |
5,082,639 | 5,082,640 | Android 4.0.3 switching Enter button with Search button on soft keyboard | <p>I'm trying to get this working: in my XML in EditText I have:</p>
<pre><code> android:imeActionLabel="Search"
android:imeOptions="actionSearch"
</code></pre>
<p>But it doesn't work. In code </p>
<pre><code> search.setImeOptions(EditorInfo.IME_ACTION_SEARCH);
</code></pre>
<p>Doesn't work either. Any clues?</p>
| android | [4] |
669,783 | 669,784 | Time for App aproval on Android | <p>I'm wondering when i can expect a app to go thourgh the reviewing process and going into the android market, because I know that apps in the iphone market take like a day to a month, is it the same for the android? </p>
| android | [4] |
3,669,796 | 3,669,797 | how to order a Localized text list | <p>I wonder if anyone can tell me or give me a guide of how can I order a objet List(Key,Name) by name, but name is in LocalizedText format and maybe I'm so stupid, but I can't order this List.</p>
<pre><code>//Objects definied on my class:
[DataMember]
public virtual Guid ComplaintPreventableStateId { get; set; }
[DataMember]
public virtual LocalizedText Name { get; set; }
//function that tries to get information:
IList<ComplaintPreventableState> complaintPreventableList = new List<ComplaintPreventableState>();
complaintPreventableList = (from c in ComplaintPreventableState.All select c).ToList();
//Tried this two options:
complaintPreventableList.OrderByDescending(h => h.Name);
complaintPreventableList.OrderBy(h => h.Name);
</code></pre>
| asp.net | [9] |
1,683,151 | 1,683,152 | If statements based on url | <p>I'm attempting to show a div tag based on the root url of my site i.e. if the url is dev.foo.com display div if else www.foo.com don't display etc. I've come up with this</p>
<pre><code><?php if (substr($_SERVER['REQUEST_URI'], 0, 5) !== 'dev.') {
echo '<div class="dev-site-stuff">THIS IS THE DEV SITE!!</div>';
}
?>
</code></pre>
<p>But it isn't working and I can't see a reason - any thoughts greatly appreciated!</p>
| php | [2] |
3,962,659 | 3,962,660 | adding text in the backend destroying markup in richTextbox | <p>I'm making a small text editor in an greater application, so I've taken an richtextbox and added an tool strip whit somme buttons.</p>
<p>Actualy everything works of the edditing part.
My app requires to add a date time in the textbox everytime a button is clicked
and when I do so, the whole markup is gone.</p>
<p>So what I do is:</p>
<pre><code> private void button_click(object sender, EventArgs e)
{
richtextbox1.text += DateTime.Now.toString();
}
</code></pre>
| c# | [0] |
1,544,899 | 1,544,900 | Moving down a level in a directory | <p>is it possible to move down a level in directory in java</p>
<p>for example in command prompt</p>
<p>C:\Users\foo\</p>
<p>i can use cd.. to go to</p>
<p>C:\Users\</p>
<p>is it possible to do this in java, because i am getting a directory using System.getProperty("user.dir"); however that is not the directory i would want to work at, but rather 1 level down the directory.</p>
<p>I have thought of using the Path class method; subpath(i,j) but if the "user.dir" were to be changed to another directory , then the returned subpath would be different.</p>
| java | [1] |
4,565,268 | 4,565,269 | Copy/Paste functionality in UITableViewController | <p>I have a UITableViewController. I want to pop the copy/paste menu up when the user touches a cell. I want to do as in the Contacts app. How to implement this functionality. Can someone help me.</p>
<p>I tried this code,</p>
<pre><code>UIMenuController *theMenu = [UIMenuController sharedMenuController];
[theMenu setTargetRect:CGRectMake(10, 200, 100, 40) inView:[self tableView]];
[theMenu setMenuVisible:YES animated:YES];
</code></pre>
<p>But it doesn't work. My question is,</p>
<ol>
<li>What CGRect I have to pass as the setTargetRect parameter?</li>
<li>Do I need to call SetNeedsDisplayInRect in my TableViewController?</li>
<li>What else to do to make this work?</li>
</ol>
| iphone | [8] |
3,118,095 | 3,118,096 | get the value of radio button and then proceed to autosuggest | <p>hello
i have developed an autosuggest in my site and it works fine and now the problem is now an user selects an radio button the autosuggest should go to corresponding suggestion </p>
<pre><code>$().ready(function() {
$("#q").autocomplete('?h=sugg&a='+$("#rad").val(), {
width:350,
max: 10,
highlight: false,
scroll: true,
scrollHeight: 300,
selectFirst: false,
formatResult: function(data, value) {
return value.split(".")[0];
}
});
<input name="q" id="q" autocomplete="off" />
<input type="radio" name="rad" value="radio" id="rad_0" checked="checked" />
Radio</label>
<br />
<label>
<input type="radio" name="rad" value="radio1" id="rad_1" />
Radio</label>
</code></pre>
<p>the thing is it always selects the default value it does not change if i select the other please tell me how can i do that...</p>
| jquery | [5] |
2,596,136 | 2,596,137 | jQuery Date Picker: Select Weeks at a Time | <p>I know that there are lots of jQuery date pickers available and I have looked through a number. Essentially, I need a date picker that allows the user to select only entire weeks at a time. The user is picking room reservations, which last for a week. Therefore, I want the date picker to show such explicitly.</p>
<p>Before I modified a date picker, I figured I would see if anyone knew of a date picker that already does such. Currently I am using Datepicker (<a href="http://keith-wood.name/datepick.html" rel="nofollow">http://keith-wood.name/datepick.html</a>), but I don't mind using something else.</p>
<p>Thank you for any help!</p>
| jquery | [5] |
4,691,364 | 4,691,365 | End the jQuery function when its recalled | <p>i build a jQuery function here <a href="http://jsfiddle.net/JuW3B/3/" rel="nofollow">http://jsfiddle.net/JuW3B/3/</a> </p>
<p>i want this function stop animating and completes it's animation when it's recalled by another action before the first animation completed,</p>
<p>so, when it's called like this</p>
<pre><code>$('.a').pushUp();
</code></pre>
<p>and then another action which call to this function before the first function completing it's animation</p>
<pre><code>$('.b').pushUp();
</code></pre>
<p>i want to forcedly ended the first function before the second function begin</p>
| jquery | [5] |
5,639,579 | 5,639,580 | Android putting all my canvas drawing into another class? | <p>I am delving into the art of android and canvas and I have everything up and running and a little project I am working on! I have created a framework for a canvas loop to display animation the part where I draw to the canvas is as follows;</p>
<pre><code>// DRAW TO THE CANVAS
@Override
public void onDraw(Canvas canvas) {
// CLEAR CANVAS
canvas.drawColor(Color.YELLOW);
androidMan.draw(canvas);
circle.draw(canvas);
square.draw(canvas);
}
</code></pre>
<p>All of the 3 objects appear and everything works fine. As I am new to both java and android I would like to put those 3 draw statements into a seperate class if possible so I can have the <code>onDraw</code> look something like,</p>
<pre><code>// DRAW TO THE CANVAS
@Override
public void onDraw(Canvas canvas) {
// CLEAR CANVAS
canvas.drawColor(Color.YELLOW);
renderCanvas();
}
</code></pre>
<p>And within render canvas something like </p>
<pre><code>androidMan.draw(canvas);
circle.draw(canvas);
square.draw(canvas);
</code></pre>
<p>But when I do this it doesn't work and the app fails to load on my phone, thanks even if the question is stupidly thick! If possible I would like <code>renderCanvas</code> to be its own file.</p>
| android | [4] |
3,219,671 | 3,219,672 | PHP file redirecting user when it is not supposed to | <p>I'm making a login script for a Server CP although it doesn't seem to work as intended, I can login but if I go to the index page it doesn't redirect me to the admin page, code here:</p>
<p>All Code: <a href="http://pastebin.com/DC8fVtD5" rel="nofollow">http://pastebin.com/DC8fVtD5</a></p>
<p>Could anyone shed any light on this for me please? :) The problem is with the cookies or the sessions but I'm not sure how to fix it. The script needs to check user input against a mysql database and see if they have an account for the website and if so, log them in. It seems to be logging me in although admin.php seems to be redirecting me to index.php when $logged != 0. I haven't been able to find a fix for it and it is driving me nuts. D:</p>
| php | [2] |
3,995,793 | 3,995,794 | iPhone, how to got the lines count of the UITextView text content? | <p>all, as topic, I want know the lines count of the UITextView, because I do not want user use scorll bar to scrolling the content , so I want split the content to multi-sub content to show in the UITextView in order . </p>
<p>thanks for helping . </p>
<p>Regards</p>
| iphone | [8] |
311,975 | 311,976 | JQuery - Hover event not firing on Hover out | <p>I am implementing my own 'tooltip' where it creates a new div element every time you hover over it and removes it on hover out. The code below is stripped down from what I use but it shows the problem: This piece of code works perfect when a user slowly puts their mouse over and off the $('#' + fieldName) object but when you move your mouse on the object and then quickly pull it off the tooltip does not get removed. Is there a way to improve my code? </p>
<p>I tried implementing a system where I create all the tooltip boxes and hide them, then show them on hover, but it posed the same problem with the mouse moving quickly off the object and the hover out not firing. </p>
<pre><code>$('#' + fieldName).hover(
function () { /* Create new DOM element */
/* My ajax stuff here */
var data = 'test';
var tooltipBox = $('<div id="' + fieldName + '_tooltip">' + data + '</div>');
$("body").prepend(tooltipBox);
},
function () { /* Remove Tooltip from DOM */
$('#' + fieldName + '_tooltip').remove();
}
);
</code></pre>
<p><strong>Answer:</strong></p>
<p>With help from Robert Koritnik and sajawikio:</p>
<p>If you need to make tooltips on hover with AJAX calls in the hover you can do a small hack to make it work.</p>
<pre><code>var callingAjax = false;
var removeTooltip = false;
$('#tooltip').hover(
function() {
callingAjax = true;
$.post(.. {
callingAjax = false;
/* do stuff */
if(removeTooltip)
/* code to remove tooltip */
removeTooltip = false;
});
},
function() {
if(callingAjax)
removeTooltip = true;
else
/* code to remove tooltip */
}
);
</code></pre>
| jquery | [5] |
423,091 | 423,092 | How to send source code - very common question | <p>I wanted to know what part of the project I need to copy for my USB for example in order to get the source code of the project. Do I need to copy the whole folder? Or do I need only the .sln file? Or..?because I've tried to copy the .sln file and when I try to open it with the other computer, it says that it can't open it for some reason.
Thanks in advance.</p>
| c# | [0] |
5,143,007 | 5,143,008 | Sharing a text to Evernote in iphone sdks | <p>How to share a Note or a text to evernote in iphone sdk?i downloaded the API along with the sample project from the EverNote website,but the sample application is not working,it crashes.
after some googling i get this <a href="http://digitalpericope.net/?p=27" rel="nofollow">link</a>,but i didnt know how to implement this.but i just want to know how to share a text from a application to evernote.
Thanks in advance.</p>
| iphone | [8] |
290,410 | 290,411 | Why are these two JavaScript Date objects not the same? | <p>I`m a beginner reading a tutorial about Dates in JavaScript, and it gives this example to compare the time between two events. </p>
<p>I don't really understand why firstDate and var secondDate wouldn't be the exact same time? does the new Date object in var secondDate only take the time once doEvent is triggered, whereas firstDate takes the time with window.onload?</p>
<p>Also, why would the variable firstDate not have the "var" tag, while variable secondDate does? would that be just a typo by the author, or is it significant in some way?</p>
<pre><code>var firstDate;
window.onload=startTimer;
function startTimer(){
firstDate = new Date();
document.getElementById("date").onclick=doEvent;
}
function doEvent() {
var secondDate = new Date();
alert((secondDate - firstDate) / 1000);
}
</code></pre>
| javascript | [3] |
3,824,930 | 3,824,931 | Android Collada | <p>Does anyone know a tutorial or an example on how to load .dae (collada) files in Adnroid and use this files with OpenGL-Es ?</p>
| android | [4] |
1,061,211 | 1,061,212 | question on string iterators | <p>I have following code</p>
<pre><code>#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(){
string d="georgia is nice country":
string::iterator my;
for (my=d.begin();my!=d.end();my++) {
cout<<*my<<endl;
}
return 0;
}
</code></pre>
<p>but it causes a compiler error saying "my is undefined". What is wrong?</p>
| c++ | [6] |
854,489 | 854,490 | What's a convenient way of resolving a path /bar/foo/baz/../.. into /bar? | <p>Is there a module capable of doing this, or should I write something myself?</p>
| python | [7] |
3,360,786 | 3,360,787 | Is it posible to open a cind of browse for file window to get the filepath of a file in c++? | <p>And if this is possible pleas explain how to do this.</p>
| c++ | [6] |
1,752,915 | 1,752,916 | Is it a good practice to define IHaveVirtualDestructor base class in my C++ application? | <p>I would like to define a class that looks like this:</p>
<pre><code>class IHaveVirtualDestructor
{
public:
virtual ~IHaveVirtualDestructor();
};
</code></pre>
<p>And I would like all my interface and abstract classes to inherit this class. Is it a good practice? Or should every interface/abstract class define its own virtual destructor? What are the drawbacks?</p>
| c++ | [6] |
2,600,372 | 2,600,373 | reg exp - search() | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/494035/how-do-you-pass-a-variable-to-a-regular-expression-javascript">How do you pass a variable to a Regular Expression JavaScript?</a> </p>
</blockquote>
<p>how to write a variable into a reg exp pattern?</p>
<p>here the pattern always is /value/i</p>
<pre><code>var value = inp.val();
if(search_list[key].search(/value/i) >= 0) alert('ok');
</code></pre>
| javascript | [3] |
2,539,200 | 2,539,201 | Terminating ASync tasks | <p>I'd like to know if anyone has ever managed to terminate an Async task? <code>Cancel</code> doesn't work, for some reason, and every time you restart the Activity a new task is started, the previous ones still remain.</p>
| android | [4] |
3,346,488 | 3,346,489 | Compressing recorded video in iphone | <p>I am developing an application which records the video and saves that video in database, now i want to reduce the resolution and bitrate/sec of recorded video how i can do that. any help on it.</p>
<p>thank you.</p>
| iphone | [8] |
6,012,270 | 6,012,271 | is it possible to load a picture in an alert box? | <p>I am trying to have a picture to load onclick into an alert box but I am getting
<code>"[object HTMLImageElement]"</code> where the picture should be.</p>
<p>This is what I have:</p>
<pre><code> function joePic(){
var joe_fat = new Image;
joe_fat.src = "pic1.jpg";
alert (joe_fat);
}
<input type="button" value="Click here it find out" name="joePhoto" onclick="joePic()"
height="150" width="150" />
</code></pre>
<p>Is this possible?</p>
| javascript | [3] |
367,735 | 367,736 | Help required with TableView swipe delete | <p>I am trying to implement SMS kind of swipe and delete functionality.</p>
<p>In case of SMS application, an Edit button is on the left side of the navigation bar. When a swipe is attempted on a row, the Edit button changes to a Done button. If you click on Done button, the Delete mode is cancelled. If you click anywhere else on the tableview or scroll, the Delete mode is canceled again.</p>
<p>In my case, I am implementing willBeginRowEditing and didEndRowEditing as per the documentation to change view in case of swipe delete. I change Edit to Done in willBeginRowEditing and change it back in didEndRowEditing. Any scroll or any other touch automatically results in swipe delete cancellation.</p>
<p>But I do not seem to understand how to come out of the Delete mode when the user clicks on Done button. If I just change the editing mode for the tableView, didEndEditingRow is not called.</p>
<p>Is there any API to come out of swipe Delete mode?</p>
<p>Please let me know.</p>
| iphone | [8] |
5,506,582 | 5,506,583 | Battery level for playing video in android | <p>At which battery level video cannot played by videoview in android?</p>
<p>The level which is received by broadcast from</p>
<pre><code>Intent.ACTION_BATTERY_CHANGED
</code></pre>
<p>This intent will return battery level like 1,2....</p>
<p>Thanks in advance</p>
| android | [4] |
828,402 | 828,403 | where do objects, static, and constant variables live in php? | <p>where do objects, static, and constant variables live in php?</p>
<p>I'm worried if I declare too many static/constants, would result to a memory leak.</p>
<p>thank you.</p>
<p>best regards,
bhadz</p>
| php | [2] |
1,314,832 | 1,314,833 | How to create a UIButton from code instead of Interface builder? | <p>I tried to write lines below to create a button instead of using Interface Builder. But I couldn't get my button appeared. Is there something wrong with the code? Or there is other steps should be taken.</p>
<pre><code>UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button setTitle:@"button" forState: UIControlStateNormal];
playButton = button;
</code></pre>
<p>playButton is the IBoutlet of my ViewController.</p>
| iphone | [8] |
1,540,526 | 1,540,527 | Alarm manager triggered too many times | <p>I have a problem regarding Alarm manager in Android.
I have the following code snippet to set an alarm that should be fired each week(once).</p>
<pre><code> // Add the time and set when the notification will be triggered
Calendar setCalendar = item.getDate();
calendar.set(Calendar.MINUTE,setCalendar.get(Calendar.MINUTE)+10080);
//Create a new alarm intent
Intent alarmIntent = new Intent(ApplicationUtils.getApplicationContext(), AlarmReceiver.class);
PendingIntent sender = PendingIntent.getBroadcast(ApplicationUtils.getApplicationContext(), requestCode, alarmIntent, PendingIntent.FLAG_UPDATE_CURRENT);
// Get the AlarmManager service
AlarmManager alarmManager = (AlarmManager) context.getSystemService(context.ALARM_SERVICE);
alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), AlarmManager.ELAPSED_REALTIME, sender);
</code></pre>
<p>And I have to following problem. When the week is changed, the notifications are coming up and they never stop.
Does anybody have any idea how can I set the calendar so the alarms are triggered once a week?</p>
<p>Thanks, Arkde</p>
| android | [4] |
3,919,752 | 3,919,753 | How do I pass data between activities in Android? | <p>I have a scenario where after logging in through a login page, there will be sign out button on each activity.</p>
<p>On clicking signout, I will be passing the session id of the signed in user to signout.
Can anyone guide me on how to keep session id available to all activities??</p>
<p>Alternatively, are there any other solutions to this problem?</p>
| android | [4] |
2,635,675 | 2,635,676 | jQuery positioning issue | <p>I have a web form against a white background that allows the user to make certain selections. Depending on the selection that the user makes, this form could grow very long lengthwise. (Although I advised against it, the client was adamant). The form works fine and I'm happy.</p>
<p>However, at the bottom of the form is a div footer that is black and has a height of 50 pixels and the width = 100%. Is it possible to use jQuery to <em>always</em> keep it at the bottom of the form no matter what the user chooses?</p>
<p><strong><a href="https://lavaggio.net/lavagstaging/charity_page/CreditCardInfoMockup.aspx" rel="nofollow">Here is the page I am referring to.</a></strong></p>
| jquery | [5] |
197,093 | 197,094 | is there is any notification after update or changes in contact Address Book in iphone? | <p>is there is any notification after update or changes in contact Address Book in iphone</p>
| iphone | [8] |
5,415,419 | 5,415,420 | http or https when including jquery from google API | <p>Should I do this</p>
<p><a href="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js" rel="nofollow">https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js</a></p>
<p>or</p>
<p><a href="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js" rel="nofollow">http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js</a></p>
<p>When I'm including jquery using Google's CDN?</p>
| jquery | [5] |
1,172,777 | 1,172,778 | jQuery delegate() not working ie IE | <p>I have a block of code being generated dynamically using xforms and dojo.</p>
<p>The following block of jQuery works fine in chrome and firefox but not in IE:</p>
<blockquote>
<p>jQuery('.premiumBlock').delegate('.dijitCheckBoxInput', 'click', function(){
// do something
});</p>
</blockquote>
<p>The code will then "do stuff" which is working correctly in chrome and firefox, but not IE.</p>
<p>Nearly everything is created dynamically including the class names.</p>
<p>I have read other similar SO queries where the majority of suggestions have been to change .delegate() to .live() or .on(). These suggestions do not work - it would merely change the ancestor that the event will bubble to.</p>
<p>Any ideas why this may not be working and, more specifically, how I can make it work?</p>
<p>Thanks</p>
| jquery | [5] |
1,352,509 | 1,352,510 | MFMailComposer - works in simulator but not in iPhone 2G | <p>I am trying to add MFMailComposer to my iPhone app and not having much luck getting it to launch in my iPhone 2G. It always launches the email app to the accounts page and closes my app. Works like a charm in the simulator.</p>
<p>-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];</p>
<pre><code>[self displayComposerSheet];
</code></pre>
<p>}
-(void)displayComposerSheet
{</p>
<pre><code>Class mailClass = (NSClassFromString(@"MFMailComposeViewController"));
if (mailClass != nil)
{
// you have the MFMailComposeViewController class
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
NSArray *mailArr = [[NSArray alloc] initWithObjects:self.sendTo,nil];
[picker setSubject:@"Hello from iCamp America"];
[picker setToRecipients:mailArr];
NSString *emailBody = @"\n\n\email created with iCamp America\nwww.iCampAmerica.com";
[picker setMessageBody:emailBody isHTML:NO];
[self presentModalViewController:picker animated:YES];
[picker release];
[mailArr release];
}
else
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"You cannot send an email !" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
}
</code></pre>
<p>}</p>
| iphone | [8] |
4,052,953 | 4,052,954 | Insert deleted records into history table before DELETE using TRIGGER | <p>I have a gridview that displays a recordset from a table - Master2. I want to use gridview to delete records from this table. Before the delete occurs, I want to insert the record into a history table with a datetimestamp and userid from the person doing the delete. Is this possible or should I simply build out the fields with a series of drop down boxes and a single button?</p>
| asp.net | [9] |
4,123,087 | 4,123,088 | How to Load Google Maps API site in a Android Application using JavaScript | <p><a href="http://code.google.com/apis/maps/articles/android_v3.html" rel="nofollow">http://code.google.com/apis/maps/articles/android_v3.html</a></p>
<p>I tried for this tutorial for using javascript in android for google map,but I dont find any way to use the java script where to put the code of the javascript?</p>
| android | [4] |
3,095,455 | 3,095,456 | Backup app data on android without root and with a damaged micro USB port | <p>How can i backup a app's data (i.e. angry birds scores and achievements) on my nexus 7 4.2.2. My tablet is not rooted and my micro usb port is damaged disallowing me to connect to the computer. Any suggestions? Please and thank you for your time!</p>
| android | [4] |
1,637,334 | 1,637,335 | jquery change text according to id | <p>I am new using jQuery..</p>
<p>I have a list something like this</p>
<pre><code><ul id="abc">
<li><a id="sp">test</a></li>
<li><a id="sb">test2</a></li>
</ul>
</code></pre>
<p>How do i change text according to id</p>
<p>i tried something like this</p>
<pre><code> $("#abc li").click(function() {
if($("#abc li a").attr('id') == 'sp')
alert(111111);
});
</code></pre>
<p>the alert never popped up.</p>
<p>What could be wrong here</p>
<p>Thank you.</p>
| jquery | [5] |
4,108,263 | 4,108,264 | What's a good substitute for an enum? | <p>I'm writing a web service that returns different types of errors.<br>
Each method can return one of the three basic types of errors:<br>
<code>General</code>, <code>InvalidInput</code>, or <code>Non</code>.<br>
In addition to those three possible values, each method can have it's own errors (e.g. for SignIn method - InvalidPassword) - but each method can return only one error.<br>
So for example the SignIn method will be able to return one of the following error types: General, InvalidInput, Non, InvalidPassword.<br>
At first I thought of using enums, but I now think that the error types should implement inheritance because there are the basic three types, and each new method's error types inherit from that.. But I can't really think how. I thought of using a static class - but then it will only have one string static field - and inheritance is irrelevant again...<br>
Another problem with enums is that what the web service's client will get eventually is a meaningless int (through json)</p>
<p>So my question is: What is a good way of conveying the idea that there are three basic possible values, and you can add to those to make a new type of errors?</p>
| c# | [0] |
3,786,922 | 3,786,923 | Efficient OOPS Code | <p>Can anyone tell me how to code an efficient OOPS PHP code which decreases the execution time and gives more simplicity in code.......</p>
| php | [2] |
5,123,505 | 5,123,506 | I need something like a class or struct that will allow me to put functions inside of it | <p>I am looking for an upgraded version of a struct that will allow me to put functions inside of it.</p>
<p>According to:</p>
<p><a href="http://stackoverflow.com/questions/54585/when-should-you-use-a-class-vs-a-struct-in-c">When should you use a class vs a struct in C++?</a></p>
<p>a class will not provide me with this functionality.</p>
<p>Basically, I have this code:</p>
<pre><code>typedef struct Player {
float* xPointer;
float* yPointer;
float* zPointer;
float* cXPointer;
float* cYPointer;
int* hpPointer;
int* ammoPointer;
Player(int** basePointer) {
/* extra stuff */
}
} Player;
</code></pre>
<p>I need a function inside of Player called updateAmmoPointer that will change the value of ammoPointer.</p>
| c++ | [6] |
2,695,775 | 2,695,776 | location.search in javascript | <p>Hi I want to know what <code>location.search.substring(1)</code> actually does. I see this code on some website. I alert but this did not give any result. does it suppose to alert location href?</p>
<pre><code>alert(location.search.substring(1))
</code></pre>
| javascript | [3] |
3,835,982 | 3,835,983 | Why we should use inverse version of int defined by hex in C# | <p>Quote from <a href="http://www.codeproject.com/Articles/35134/How-to-calculate-CRC-in-C" rel="nofollow">this article</a>:</p>
<blockquote>
<p>In many industries, the first polynomial is in use to create CRC tables and then apply it for performance purposes. The default polynomial, defined by IEEE 802.3 is 0xA001 for 16 bit and 0×04C11DB7 for 32 bit. <strong>We're in C#, thus we should use its inversed version</strong> which is 0×8408 for 16 bit and 0xEDB88320 for 32 bit. We're going to use those polynomials also in our sample.</p>
</blockquote>
<p>Why should we use the inverse version of int defined by hex in C#?<br>
And how did the author of quoted article invert <strong>04C11DB7</strong> to <strong>0xEDB88320</strong>?</p>
<p>Also I've looked into other crc32 C# and C implementations. In all of them C uses 04C11DB7, C# uses 0xEDB88320</p>
| c# | [0] |
2,280,750 | 2,280,751 | After Importing android project | <p>I developed a project in android [API 13] but when i tried to run that project in other system having android[API 8] .
It says</p>
<p><strong>Unable to resolve target 'android-13'</strong></p>
<p>How to resolve this bug???</p>
| android | [4] |
5,203,893 | 5,203,894 | jQuery fadeIn effect | <p>I am not sure why the following code is not behaving the way I would expect it to, but as I am new to jQuery I am sure that I'm missing something elementary.</p>
<p>html:</p>
<pre><code><div id="locale"></div>
<form id="theForm">
What would you like to do?<br /><br />
<input type="text" id="doThis" /><br /><br />
</form>
</code></pre>
<p>js:</p>
<pre><code>$(document).ready(function() {
$("#theForm").submit(function(){
var doThis = $("#doThis").val().toLowerCase();
$("#locale").html(doThis).fadeIn("slow");
return false;
});
});
</code></pre>
| jquery | [5] |
846,966 | 846,967 | What is the better Way to Store fixed no of data in Java? (Array vs ArrayList) | <p>I believe Array and ArrayList both are non-Synchronised;behave same in multiThreaded env.
And both are Index based. Only Adavantage is ArrayList has utility methods and flexible. <BR>
Apart from those Utility methods only to get and set fixed no of Objects which is best in java? Is there any overhead in using Arraylist than Array? Pls explain.</p>
<p>Let us consider Scenario like </p>
<p>1) 1,00,000 Objects to be stored.
2) 1,00,000 primitives to be stored </p>
| java | [1] |
5,704,069 | 5,704,070 | Start application on bootup | <p>I have two applications which I have made to start at bootup of the phone by using the <code>BOOT_COMPLETE</code> event. I would like one application to start ahead of the other on bootup. Is there any way of setting priority so that the first application is started first. Note that I cannot start one application from the other. Kindly give me a clue on how to proceed. Thanks.</p>
| android | [4] |
5,992,215 | 5,992,216 | Can someone help me create an Up Button in action bar | <p>Im developing an application where the home view will use dashboard design. I saw in android design pattern that they introduce a new concept of using Up Button. Im confuse a little bit cause up button and back button is always the same except that you can use Up button to go directly in your home view. Can someone tell me how to create an Up Button in action bar sherlock? Please help. Thank you.</p>
| android | [4] |
2,692,957 | 2,692,958 | php $_GET error | <pre>
$url = $_GET['url'];
echo "$url";
</pre>
<p>and I request
/test.php?url=ok</p>
<p>gives me ok as output..</p>
<p>but I use a url
test.php?url=http://google.com </p>
<p>gives me 403- Forbidden error..
I donno why it's not working ..</p>
<p>Please help me..</p>
| php | [2] |
2,265,731 | 2,265,732 | connect SQlite database | <p>Im trying to view database on my web app. The problem here is that it does not view from SQLite. rather view database from chrome add-ons. Is there any way for me to view SQlite databse using Jscript?</p>
| javascript | [3] |
5,273,999 | 5,274,000 | Python : How to intercept a method call which does-not exists? | <p>I want to create a class that doesn't gives an <code>Attribute Error</code> on call of any method that may or may not exists:</p>
<p><strong>My class:</strong></p>
<pre><code>class magic_class:
...
# How to over-ride method calls
...
</code></pre>
<p><strong>Expected Output:</strong></p>
<pre><code>ob = magic_class()
ob.unknown_method()
# Prints 'unknown_method' was called
ob.unknown_method2()
# Prints 'unknown_method2' was called
</code></pre>
<p>Now, <code>unknown_method</code> and <code>unknown_method2</code> doesn't actually exists in the class, but how can we intercept the method call in python ?</p>
| python | [7] |
4,324,157 | 4,324,158 | learn and practice c++ | <p>I'm trying to learn c++ and I really want to do a lot of coding but I'm not sure what I can code.. Tbh, book exercises are not very interesting to me (usually because they're just too short). I like to code OS related stuff like I/O stuff..</p>
<p>I'm thinking of looking at linux and try mimicking some of the tools there.. is that a good idea?</p>
| c++ | [6] |
2,702,813 | 2,702,814 | C# deploy, problems with folders | <p>I've finished my app and used the visual studio installer to create a package with all the files that aplication need.</p>
<p>But the problem is that, if the user install the program in ProgramFiles directory, it won't start because he needs admin Rigths (This because the program needs sqlServerCe).</p>
<p>How i can avoid this situation?</p>
<p>Another question, if the program has the sqlServer and sqlServerCe in prerequesites it needs the sqlServerCe.dll?</p>
<p>Thanks.</p>
| c# | [0] |
739,408 | 739,409 | alternate CSV row deletion | <p>I have a csv file as follows:</p>
<pre><code>gindex
1
1
2
2
3
3
7
7
</code></pre>
<p>I printed each element twice by mistake. How can I delete each repeated row and get the following results:</p>
<pre><code>gindex
1
2
3
7
</code></pre>
| python | [7] |
2,299,175 | 2,299,176 | Android Open Accessory SDK error INSTALL_FAILED_MISSING_SHARED_LIBRARY | <p>Using the <a href="http://developer.android.com/guide/topics/usb/adk.html" rel="nofollow">Android Open Accessory Development Kit</a> and Google API 10.</p>
<p>Run in the emulator, I can install it, however when I run on my Android 2.3.4 device, Eclipse gave this error.</p>
<p>How can this be solved?</p>
<blockquote>
<p>DemoKitLaunch] Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY </p>
<p>DemoKitLaunch] Please check logcat output for more details. </p>
<p>DemoKitLaunch] Launch canceled!</p>
</blockquote>
| android | [4] |
5,782,717 | 5,782,718 | reference variable | <p>In some text it is given that we can't assign constant values to a reference variable. When I executed such a program I could do it. Is there any condition we can't assign a constant value to a reference variable?</p>
| c++ | [6] |
5,664,824 | 5,664,825 | using PHP Simple HTML DOM Parser to find <img> and height | <p>I'm using PHP Simple HTML DOM Parser to return multiple images from external pages. I need to minimize the amount of images that are returned by only returning images with a width greater than 50px and a height greater that 60px. </p>
<p>How can I use PHP Simple HTML DOM Parser to pull the height and width of each image as it runs and only returning the images that meet the requirements above?</p>
<p>Thanks!</p>
<p>EDIT added code</p>
<p>So far, this is what I have.</p>
<pre><code>foreach($html->find('img') as $element) {
$images = $element->src;
echo $images;
}
</code></pre>
| php | [2] |
336,995 | 336,996 | How to implement OnScaleGestureListener in Android? | <p>Update: Problem solved.</p>
<p>Hello,</p>
<p>I tried to implement the OnScaleGestureListener in my activity, but I received nothing. What's wrong with the following codes ?</p>
<p>Thanks.</p>
<pre><code>package com.test;
import android.app.Activity;
import android.os.Bundle;
import android.view.GestureDetector.*;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.ScaleGestureDetector.*;
import android.util.*;
public class Test10 extends Activity implements OnScaleGestureListener {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
public boolean onScale(ScaleGestureDetector detector) {
Log.d("","onScale");
return true;
}
public boolean onScaleBegin(ScaleGestureDetector detector) {
Log.d("","onScaleBegin");
return true;
}
public void onScaleEnd(ScaleGestureDetector detector) {
Log.d("","onScaleEnd");
}
}
</code></pre>
| android | [4] |
4,444,263 | 4,444,264 | iPhone UIImagePickerController video mode | <p>When using the UIImagePickerController, is there a way to specify the resolution of the captured video, or to restrict the length of the video (based on size). I would love to be able to have the video capture at a standard lower res mode rather than 720P.</p>
| iphone | [8] |
3,886,418 | 3,886,419 | Creating a matrix from simple three column text fie | <p>I'm trying to create a matrix or a contingency table from a file that has this format:</p>
<pre><code>Species Date Data
1 Dec 3
2 Jan 4
2 Dec 6
2 Dec 3
</code></pre>
<p>Result</p>
<pre><code> 1 2
Dec 3 9
Jan 4
</code></pre>
<p>More that I'd like to know how to turn myfile into an array that numpy will like. Basically I'm trying to recreate reshape from R</p>
<p>Hope this made sense. ThanksBlockquote</p>
<p>Made some edits so it might make more sense</p>
| python | [7] |
1,277,458 | 1,277,459 | Sending GMail with attachment from Android app | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/5762073/problem-attaching-internal-file-to-gmail-in-my-android-app">Problem Attaching internal file to GMail in my android app</a> </p>
</blockquote>
<p>My app writes data to text files on internal memory.<br>
Later the app emails the text files to a list of people. </p>
<p>If the user selects GMail to send the mail and attachment, the mail goes, but attachment does not. </p>
<p>I get the following message in logcat: </p>
<blockquote>
<p>ERROR/Gmail(9147): file:// attachment paths must point to file:///mnt/sdcard. Ignoring attachment file:///data/data/my.package.name/files/myfile.txt</p>
</blockquote>
<p>How should I interpret this?<br>
- Can I NEVER attach an internal memory file to a GMail?<br>
- Do I need to change permissions?<br>
- Do I need to construct my URI in different way? </p>
<p>Here's the code snippet that created the EXTRA_STREAM:</p>
<pre><code>String filename = "file://" + getFilesDir().toString() + "/myile.txt";
myintent.putExtra(Intent.EXTRA_STREAM, Uri.parse(filename));
</code></pre>
<p>BTW this works fine with built-in Android mail. It just fails on GMail.</p>
| android | [4] |
3,277,256 | 3,277,257 | iPhone SDK: To the iPhone/iTouch? | <p>I have SDK 3.1 for iPhone.</p>
<p>I have made an application, and i want this to put on my iPod Touch.</p>
<p>How to? Is there a need of paying to Apple for a paid developer account? Or is there a way to NOT pay...?</p>
| iphone | [8] |
2,494,971 | 2,494,972 | Is it possible to use long double as an integer? (adding, substracting, multiplying, dividing, perbit operations ...) | <p>As far as I know in C++ standart <code>sizeof(long double)</code> is 10 byte = 80 bit => the variable of this <code>long double</code> type can carry 2^80 different values. So my question is here, is it possible to write some wrapper or I don't know what (using, maybe, perbit operations). To use <code>long double</code> (or it wrapper) as full integer? And if there is possible, then why standart doesn't give as 80bit integer?</p>
| c++ | [6] |
4,697,949 | 4,697,950 | How to change colors of a Drawable in Android? | <p>I'm working on an android application, and I have a drawable that I'm loading up from a source image. On this image, I'd like to convert all of the white pixels to a different color, say blue, and then cache the resultant Drawable object so I can use it later.</p>
<p>So for example say I have a 20x20 PNG file that has a white circle in the middle, and that everything outside the circle is transparent. What's the best way to turn that white circle blue and cache the results? Does the answer change if I want to use that source image to create several new Drawables (say blue, red, green, orange, etc)?</p>
<p>I'm guessing that I'll want to use a ColorMatrix in some way, but I'm not sure how.</p>
| android | [4] |
1,236,177 | 1,236,178 | first is not a function | <p>I am a noob in Jquery and I am playing around with the different selectors and functions right now. I am trying to do this</p>
<pre><code>$('li').first();
</code></pre>
<p>on firefox console and I got </p>
<pre><code>TypeError: $("li").first is not a function
</code></pre>
<p>when </p>
<pre><code>$('li')
</code></pre>
<p>returns</p>
<pre><code>Object { length=8, 0=li, 1=li, more...}
</code></pre>
<p>what am i doing wrong?</p>
| jquery | [5] |
1,761,878 | 1,761,879 | select first index in collection where like | <p>I feel sometimes that I'm reinventing the wheel.</p>
<p>I'm wondering if there are any utility methods in java/jakarta commons/guava/?, that will go deeper in the collection and do something (test, modify, remove) with the elements.</p>
<p>I wrote this method and now I feel that there is some one-liner that can do it.</p>
<pre><code>/**
* Find index of first line that contains search string.
*/
public static int findIdx(List<String> list, String search) {
for (int i = 0, n = list.size(); i < n; i++)
if (list.get(i).contains(search))
return i;
return -1;
}
</code></pre>
| java | [1] |
3,231,717 | 3,231,718 | How to add a string into each and every string in an array by using javascript or jquery? | <p>Actually I want to add "*." at opening and ";" at ending on each array element. Below is the sample code.</p>
<pre><code>var ext = getExt(filename);
var s = '<%=AllowedExtensions %>';
var match = s.split(', ');
</code></pre>
<p>In the above code in 'match' I use to get ["jpg", "png", "txt"] like this. So here on each array element I want to prefix with "<em>." and at end of each want to add ";" and also it should give me a string such as "</em>.jpg;<em>.png;</em>.txt;" .</p>
<p>So please help me out on this to achieve this target.</p>
<p>Thanks.</p>
| javascript | [3] |
2,790,274 | 2,790,275 | How to pass object between python instances | <p>I have a genetic expression tree program to control a bot. I have a GP.py and a MyBot.py. I need to be able to have the MyBot.py access an object created in GP.py</p>
<p>The GP.py is starting the MyBot.py via the os.system() command</p>
<p>I have hundreds of tree objects in the GP.py file and the MyBot.py needs to evaluate them.</p>
<p>I can't combine the two into one .py file because a fresh instance of MyBot.py is executed thousands of times, but GP.py needs to evaluate the fitness of MyBot.py with each tree.</p>
<p>I know how to import the methods and Class definitions using import GP.py, but I need the specific instance of the Tree class object
Any ideas how to send this tree from the first instance to the second?</p>
| python | [7] |
3,330,820 | 3,330,821 | Floats and scientific notation | <p>I am creating 1D and 2D array from a file that contains lines that look like this:</p>
<p>42857000 -923070 0 0 -7887
428570 -546190 -4285700 546190 0
-6.5 -0.15384 6.5 0.15384 0.007
0 0 42857000 360570 0</p>
<p>When I populate the arrays from the file, they get converted to scientific notation:</p>
<p>42857000 >>>>> 4.2857000e+007 etc!!!</p>
<p>Is there anyway to stop this?</p>
<p>My arrays are defined as follows:</p>
<pre><code>float aMatrix[DEFROWS][DEFCOLS] = {0.0};
float bMatrix[DEFCOLS] = {0.0};
</code></pre>
<p>This issue is causing my app to crash.</p>
<p>Thanks.</p>
| c++ | [6] |
302,665 | 302,666 | Pass a targeted method as a parameter | <p>first of all, my english is not very good so if you could be kind it would be appreciated. Thanks.</p>
<p>Now my problem, like I said in the title, I would like to pass a "method name" as a parameter in another method. Like a picture is worth thousand words, there is a chunk of my function:</p>
<pre><code> public void RemoveDecimalPoints(TextBox txtBoxName, Func<string, TextBox> txtBoxMethod)
{
//Some Code
txtBoxName.KeyPress += new KeyPressEventHandler(txtBoxMethod);
}
</code></pre>
<p>I want the second parameter to point to this other method: </p>
<pre><code> private void txtIncomeSelfValue1_KeyPress(object sender, KeyPressEventArgs e)
{
//Some Code
}
</code></pre>
<p>Sorry if im not clear for some, I lack some vocabulary...</p>
<p>Thanks for your help.</p>
| c# | [0] |
3,382,209 | 3,382,210 | GetTimeZoneInformation equivalent in ubuntu? | <p>i am using <code>GetTimeZoneInformation</code> in windows...but not able to find any equivalent in linux.
Any idea??</p>
| c++ | [6] |
435,098 | 435,099 | android Custom ListView selected row on button click | <p>I have custom listview with textview and button. I set the button click handle in the xml files and the implementation in the ListActivity.</p>
<p>The problem is when i click the button, I cant get which selected row that i click.</p>
<p>Regards</p>
| android | [4] |
1,106,316 | 1,106,317 | Php string handling tricks | <p>Need to get the 10 word before and 10 words after for the given text . i mean need to start the 10 words before the keyword and end with 10 word after the key word.</p>
<p>Given text : "Twenty-three" </p>
<p>The main trick : content having some html tags etc .. tags need to keep that tag with this content only . need to display the words from 10before - 10after</p>
<p>content is bellow :</p>
<pre><code>removed
</code></pre>
<p>Thank you </p>
| php | [2] |
4,618,264 | 4,618,265 | Need to search a content which is in greek letters using strtoupper and strtolower | <p>I am currently working in a GREEK project. In that project all the contents are GREEK and in that i have a search functionality. Search process is good. But strtoupper() didn't convert the Greek language to upper case and strtolower() didn't convert the Greek language to lower case. </p>
<p>But for English language its working fine. Is there any possible way to convert the Greek letters to UPPER and LOWER case.</p>
<p>thanks</p>
<p>Fero</p>
| php | [2] |
4,852,975 | 4,852,976 | JAXBElement<String> to String using Simple Framework for Android | <p>I'm having big time trouble with Android Webservice.</p>
<p>I am converting JAXB Annotation to Simple Annotation. Please see below.</p>
<p>Here is my JAXB Annotation:</p>
<pre><code>@XmlElementRef(name = "Title", namespace = "http://xxx.org/2004/07/Course", type = JAXBElement.class, required = false)
protected JAXBElement<String> title;
</code></pre>
<p>I get the value using getTitle().value();</p>
<p>After mapping to Simple Annotation like this:</p>
<pre><code>@Element(name = "Title", required = false)
protected String title;
</code></pre>
<p>and getTitle() returns null. how can i get the value ?</p>
<p>I cannot use JAXB on Android. So how could I properly use Simple Framework to get the value?</p>
<p>I badly need help on this. Thank you so much. </p>
| android | [4] |
2,723,558 | 2,723,559 | php login: undefined index | <p>Im very new to php and this is my first go on on this login.
so when im typing in a valid username and password from the database im getting these two errors:</p>
<p>Notice: Undefined index: brukernavn on line 3</p>
<p>Notice: undefined index: passord on line 4<br>
<pre><code>$username = $_POST['brukernavn'];
$password = $_POST['passord'];
if($username&&$password)
{
$connect = mysql_connect("localhost", "root", "") or die ("Cannot connect");
mysql_select_db("prosjekt") or die ("Cant find db");
$query = mysql_query("SELECT * FROM bruker WHERE brukernavn='$username'");
$radnum = mysql_num_rows($query);
if ($radnum!=0)
{
while ($rad = mysql_fetch_assoc($query))
{
$dbuser = $rad['brukernavn'];
$dbpass = $rad['passord'];
}
if ($username==$dbuser&&$password==$dbpass)
{
echo "Logged in";
}
else
echo "Wrong username or password";
}
else
die("That user does not exist!");
}
else
die("Please enter a username and password!");
?>
</code></pre>
<p>Could anyone see where i went wrong here?</p>
| php | [2] |
1,405,022 | 1,405,023 | How to run the Tabbar without clicking the Tabs in Android | <p>I have a Tab bar application with two tabs named "Tab1" and "Tab2".</p>
<p>Whenever I launch the application ,the Tab Bar runs and the "Tab1" in the Tab Bar get selected and it runs an Activity, because I have used setCurrentTab(0) method.</p>
<p>So how can I run the Second Tab named "Tab2" simultaneously along with the "Tab1" without clicking. Here I cannot use setCurrentTab(1),because I have already used setCurrentTab(0).</p>
<p>Any suggestions as to how I can do this?</p>
| android | [4] |
5,301,843 | 5,301,844 | Will inlining Javascript reduce the chance of delays? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/138884/when-should-i-use-inline-vs-external-javascript">When should I use Inline vs. External Javascript?</a> </p>
</blockquote>
<p>Often Javascript needs to be run as soon as possible. For example, suppose I have some radio buttons in a form and when the form fails to submit, the Javascript selects the last button that I selected. If one button is selected by default and the user sees this and then the Javascript changes buttons, it will look weird. Therefore, the script should run as soon as possible and it seems that inlining Javascript might help with this. Is this likely to make a significant difference in terms of reducing how often users see this kind of weird behaviour?</p>
| javascript | [3] |
1,963,460 | 1,963,461 | How to sort ArrayList of DateTime objects in descending order? | <p>How do I sort ArrayList of DateTime objects in descending order?</p>
<p>Thank you.</p>
| c# | [0] |
360,094 | 360,095 | Geeting data from post in PHP and insert into table | <p>I am getting data from iphone using php but when i insert post data in table it gives error </p>
<pre><code> mysql_select_db("emriphone", $con);
$providernpi=$_POST['ProviderNPI'];
$patienid=$_POST['PatientID'];
$fileurl=$_POST['FileURL'];
$filetype=$_POST['FileTYPE'];
$datasynid=$_POST['DataSynID'];
$query = "INSERT into AppointmentDataSync (ProviderNPI,PatientID,FileURL,FileType,DataSyncID) VALUES('$providernpi','$patientid','$fileurl','$filetype','$datasynid')"
$con = mysql_query($query,$con);
$cnt = mysql_num_rows($con);
echo($providernpi)
?>
</code></pre>
| php | [2] |
145,988 | 145,989 | why this kind of error coming C#? | <p>Error 1 The type or namespace name 'ServiceContract' does not exist in the namespace 'Net_Name_Pipe' (are you missing an assembly reference?) E:\DemoWCF\Net_Name_Pipe\DisplayNamedMessage\Form1.cs 12 21 DisplayNamedMessage</p>
| c# | [0] |
462,434 | 462,435 | Is it possible to sort two lists(which reference each other) in the exact same way? | <p>Okay, this may not be the smartest idea but I was a bit curious if this is possible. Say I have two lists:</p>
<pre><code>list1 = [3,2,4,1, 1]
list2 = [three, two, four, one, one2]
</code></pre>
<p>If I run <code>list1.sort()</code>, it'll sort it to <code>[1,1,2,3,4]</code> but is there a way to get to keep list2 in sync as well(so I can say item 4 belongs to 'three')? My problem is I have a pretty complex program that is working fine with lists but I sort of need to start referencing some data. I know this is a perfect situation for dictionaries but I'm trying to avoid dictionaries in my processing because I do need to sort the key values(if I must use dictionaries I know how to use them).</p>
<p>Basically the nature of this program is, the data comes in a random order(like above), I need to sort it, process it and then send out the results(order doesn't matter but users need to know which result belongs to which key). I thought about putting it in a dictionary first, then sorting list one but I would have no way of differentiating of items in the with the same value if order is not maintained(it may have an impact when communicating the results to users). So ideally, once I get the lists I would rather figure out a way to sort both lists together. Is this possible?</p>
| python | [7] |
5,591,235 | 5,591,236 | What's the difference between android and com.android? | <p>What's the difference between android and com.android? </p>
<p>For instance, the file android/nfc/ErrorCodes.java has a different content than com.android/nfc/ErrorCodes.java - both file exist in the Android's source code.</p>
<p>I want to know why there is a package called android, and also one called com.android. Why com.android was not enough so they also made android, with no dots? I want to understand why the content of the files with the same name is different. </p>
| android | [4] |
2,124,158 | 2,124,159 | Automating tasks through java | <p>Here's the problem:</p>
<ol>
<li>Run a java client as a batch job on a unix box which will connect to Oracle and fetch some data.</li>
<li>Update an excel sheet (on a Windows machine) with the data fetched.</li>
<li>Create a chart/graph from the data in excel sheet.</li>
<li>Send the excel (with data & graph) in an email.</li>
</ol>
<p>All the above steps must be performed without any manual intervention. </p>
<p>Could there be a better option to excel based solution? The main intent is to have a history of data fetched and have a chart created from that data. </p>
<p>I know there are many open source libraries available for creating charts like JFreeChart, but is there anything in the JDK that allows you to create charts? Could JavaFX be used for this problem? </p>
<p>In short, is it possible to do this with just jdk (without using any open source libraries)?</p>
<p>Any help/suggestion will be appreciated.</p>
| java | [1] |
448,609 | 448,610 | Is it possible to validate the size of multipart form on the client side using jQuery? | <p>Is it possible to use jQuery to make sure that the multipart form data that is submitted by a form does not exceed a given size?</p>
| jquery | [5] |
3,924,232 | 3,924,233 | if statement in php form and form output | <p>I am creating a order form for a meat locker company that sends the form to their email. There is a lot of where if you select one item you can not select another item; such as t-bone and New York Strip, you can have one or the other, but not both. Here is what my code looks like.</p>
<pre><code><P>T-bone steak <input type="radio" name="T-bone and NY" id="T-bone steak" />
or New York Strip steak <input type="radio" name="T-bone and NY" id="New York Strip" /> </p>
</code></pre>
<p>This does prevent a person from selecting both, but when he views in in his email he sees name="T-bone and NY" so he doesn't know which one they selected. I thought it would display the id="T-bone" or "NY Strip". I'm sure there is a better way of doing this with an if statement.</p>
<p>Second, when they receive the email it has all of the names of the fields people selected and it says on afterwords. For example if someone selected Prime rib the email would say:</p>
<p>Prime Rib: on </p>
<p>Is there a way to send the form exactly as the user sees it. Maybe in an image, word doc, or access data base?? I'm open to anything. </p>
<p>If your want to see it the url is www.spillvillelocker.com/beef.php</p>
<p>Thank you very much:)</p>
| php | [2] |
1,114,857 | 1,114,858 | Android - android.view.InflateException with a custom view | <p>Hi i keep getting this error
its an android.view.InflateException at line #9 xml</p>
<p>Heres my xml:</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<com.SpaceShot.single android:id="@+id/single1"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</com.SpaceShot.single>
<ListView android:id="@+id/highScores"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</ListView>
</FrameLayout>
</code></pre>
| android | [4] |
3,332,793 | 3,332,794 | Jquery help regarding hiding selected div divs | <p>i have say five divs with the layout as in the following code..</p>
<pre><code>//Div one
<div class="container">
<div class="hide">
<button class="hide" value="hide" />
</div>
</div>
//Div Two
<div class="container">
<div class="hide">
<button class="hide" value="hide" />
</div>
</div>
//Div Three
< div class="container">
<div class="hide">
<button class="hide" value="hide" />
</div>
</div>
</code></pre>
<p>now say i click the hide button in the second div, i want to hide the second div.. That is i want to hide the div corresponding to the button click..
How to do that via jquery only???</p>
<p>i tried using the 'this' keyword through jquery but that would hide all the containers and not just one.
please help me</p>
| jquery | [5] |
5,716,560 | 5,716,561 | Creating an ImageView with a certain style programatically | <p>I want to do this programatically:</p>
<pre><code><ImageView style="@style/TitleBarSeparator" />
</code></pre>
<p>Where <code>TitleBarSeparator</code> is:</p>
<pre><code><style name="TitleBarSeparator">
<item name="android:layout_width">1px</item>
<item name="android:layout_height">fill_parent</item>
<item name="android:background">@color/title_separator</item>
</style>
</code></pre>
<p>I've tried:</p>
<pre><code>new ImageView(getContext(), null, R.style.TitleBarSeparator);
</code></pre>
<p>but it doesn't work.
I guess the error comes from passing null as <code>AttributeSet</code> but I am not completely sure.</p>
| android | [4] |
5,895,324 | 5,895,325 | uint is 32 bits no matter the system is 32 or 64 bits? | <p>in C#, uint is a UInt32 type so it will be always 32 bits long no matter the OS is 32 or 64 bits. Am I right?</p>
| c# | [0] |
4,554,663 | 4,554,664 | Casting/dereferencing member variable pointer from void*, is this safe? | <p>I had a problem while hacking a bigger project so I made a simpel test case. If I'm not omitting something, my test code works fine, but maybe it works accidentally so I wanted to show it to you and ask if there are any pitfalls in this approach.</p>
<p>I have an OutObj which has a member variable (pointer) InObj. InObj has a member function. I send the address of this member variable object (InObj) to a callback function as void*. The type of this object never changes so inside the callback I recast to its original type and call the aFunc member function in it. In this exampel it works as expected, but in the project I'm working on it doesn't. So I might be omitting something or maybe there is a pitfall here and this works accidentally. Any comments? Thanks a lot in advance.</p>
<p>(The problem I have in my original code is that InObj.data is garbage).</p>
<pre><code>#include <stdio.h>
class InObj
{
public:
int data;
InObj(int argData);
void aFunc()
{
printf("Inside aFunc! data is: %d\n", data);
};
};
InObj::InObj(int argData)
{
data = argData;
}
class OutObj
{
public:
InObj* objPtr;
OutObj(int data);
~OutObj();
};
OutObj::OutObj(int data)
{
objPtr = new InObj(data);
}
OutObj::~OutObj()
{
delete objPtr;
}
void callback(void* context)
{
((InObj*)context)->aFunc();
}
int main ()
{
OutObj a(42);
callback((void*)a.objPtr);
}
</code></pre>
| c++ | [6] |
5,936,618 | 5,936,619 | python lookup table | <p>I have a need to create a lookup table where A=10 and Z=35(B=11, C=12 and so on), what's the easiest way to accomplish this in python? I know there must be a very easy way to do it, just can't seem to find it.</p>
| python | [7] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.