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 |
---|---|---|---|---|---|
3,551,229 | 3,551,230 | Create class with interface using C# abstract factory | <p>How to create a class with interface using C# abstract factory? Can anybody explain with example.</p>
| c# | [0] |
3,968,844 | 3,968,845 | Why isn't my hover event firing in JQuery? | <p>I'm not sure why my event isn't firing? I simply want to change the list style type when the user hovers over an li. It doesn't look like I'm missing anything, but nothing is happening.</p>
<pre><code><%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<link href="theme.css" rel="stylesheet" type="text/css" />
</head>
<script type="text/javascript">
$(".component ol li").hover(function() {
$(this).css('list-style-type', 'disc');
}
);
</script>
<body>
<form id="form1" runat="server">
<div class="component">
<ol>
<li><a href="#"></a>&nbsp;</li>
<li><a href="#"></a>&nbsp;</li>
<li><a href="#"></a>&nbsp;</li>
<li><a href="#"></a>&nbsp;</li>
<li><a href="#"></a>&nbsp;</li>
</ol>
</div>
</form>
</body>
</html>
</code></pre>
| jquery | [5] |
154,395 | 154,396 | How to add the data from tableview to sql | <p>I am making an application. On one of the tab I have used tableview on which I am adding the local notifications timing by using time picker. I am also using sql database in my app. Now I want the timing which I have added in the table view must be store in database so that I can retrieve it on another tab. How Can I do this implementation. Please If anyone know it. Give me some solutions.</p>
<p>Thanks alot. </p>
| iphone | [8] |
2,163,124 | 2,163,125 | Android jpg animation | <p>I would like to download 10 JPG pictures from a site.</p>
<p>The pictures where taken at intervals >> that is no problem</p>
<ol>
<li>How do I save pictures in an array of pictures.</li>
<li>How would I show them as a moving picture (movie like).</li>
<li>What component to use on Android (imageView, animator)? </li>
<li>How would I animate the component? </li>
</ol>
<p>Any specific examples would be greatly appreciated.</p>
| android | [4] |
3,864,537 | 3,864,538 | Execute a timeline of actions | <p>i have a bunch of actions that need to be executed in an android app after an exact waiting period.</p>
<p>action 1: start after 1000ms<br>
action 2: start after 2000ms<br>
action 3: start after 3000ms</p>
<p>i developed 2 different approaches to achieve this. one with a ScheduledThreadPoolExecutor and one with a loop. the ScheduledThreadPoolExecutor results in an OutOfMemoryException if there are too many actions to execute and feels also not so precise. the version with the loop works actually quite well and feels precise, but uses of course an awful lot of CPU power.</p>
<p>does anyone have experience with a similar task and could give me a hint what the best method is?</p>
<p>oh, this will of course run in an AsyncTask.</p>
<p>thx
simon</p>
<pre><code>int[] times = new int[]{ 1000, 2000, 3000 };
// 1. use ScheduledThreadPoolExecutor
ScheduledThreadPoolExecutor ex = new ScheduledThreadPoolExecutor(times.length);
for(int i = 0; i < times.length; i++){
ex.schedule(new Runnable() {
@Override
public void run() {
System.out.println("timer");
}
}, times[i], TimeUnit.MILLISECONDS);
}
// 2. use loop
int i = 0;
int max = times.length;
long start = System.currentTimeMillis();
while(i < max){
int t = times[i];
long diff = System.currentTimeMillis() - start;
if(diff >= t){
System.out.println("loop");
i++;
}
}
</code></pre>
| android | [4] |
3,133,073 | 3,133,074 | Error when trying to launch an executable .jar file | <p>Hi
when in try to run jar file this error shown : "failed to load main-class manifest attribute from ..."
but when i run project in netbeans it`s run successfuly !!!</p>
| java | [1] |
977,841 | 977,842 | jquery How to loop through a series of items and take action? | <p>Given HTML like:</p>
<pre><code><div class="itemList">
<div class="streamBox version-2"> stuff </div>
<div class="streamBox version-2"> stuff </div>
<div class="streamBox version-3"> stuff </div>
<div class="streamBox version-2"> stuff </div>
<div class="streamBox version-3"> stuff </div>
<div class="streamBox version-1"> stuff </div>
</div>
</code></pre>
<p>How can I get jquery to loop through all the '.streamBox' inside of the '.itemList' div?</p>
<p>When looping through, given a version #, like 2, how to get it to show() version-2 but hide all the others?</p>
<p>Thanks</p>
| jquery | [5] |
4,803,858 | 4,803,859 | Using a console application to reference a VB.net exe form function | <p>I am very new to referencing dll's and .exe's. I have an application that sends reports to users on a daily basis. This is a manual process, and I have been tasked to automate that process. Now, I would like to create a console application, and reference that form that does the work on the .exe. I am so lost on how to do this. Can anyone provide me with a sample or tutorial on how to do this?</p>
| c# | [0] |
3,202,814 | 3,202,815 | APN Setting In Android | <p>I am trying to use APN on my application ,can I know how I can configure the APN setting programmatically in android? I also read some of instruction and code given on <a href="http://blogs.msdn.com/b/zhengpei/archive/2009/10/13/managing-apn-data-in-google-android.aspx" rel="nofollow">MSDN</a> and <a href="http://www.netmite.com/android/mydroid/packages/providers/TelephonyProvider/src/com/android/providers/telephony/TelephonyProvider.java" rel="nofollow">NetMite</a>
I want to set my own APN that will not affect System Default APN setting.
I am using this Uri</p>
<pre><code>APN_TABLE_URI = Uri.parse("content://telephony/carriers");
</code></pre>
<p>to add new APN setting using ContentValues. First, how I can check my new APN set? It not displaying in phone APN setting but my insert query running without exception etc. but when I retrieved it gives me other values else what I insert, </p>
<pre><code>Cursor your=getApplicationContext().getContentResolver().query(Uri.parse("content://telephony/carriers/"), null, null,null, null);
</code></pre>
<p>if me Phone APN not my new inserted APN.
Anyone can guide me for this..?
I read about APN setting from this page <a href="http://blogs.msdn.com/b/zhengpei/archive/2009/10/13/managing-apn-data-in-google-android.aspx" rel="nofollow">http://blogs.msdn.com/b/zhengpei/archive/2009/10/13/managing-apn-data-in-google-android.aspx</a> .now question is this how I can access telephony.db as mentioned on above given page. </p>
| android | [4] |
5,435,556 | 5,435,557 | What is an efficient way of waiting for a dynamically loaded Javascript file to finish loading? | <p>I'm loading a Javascript file that has a function in it that I'd like to call. This is not possible, since between 'initiating' the load, and actually calling the function, the JS isn't loaded yet. Of course, I could do something like <code>setTimeout('functionCall();',5000);</code>, but I don't think this is a very efficient method, and it seems really unstable to me. That's why I was wondering whether there was a better way to do it.</p>
<p>Here's the code I'm using. The function in question is called <code>controllerStart</code>. If I comment out the last line here, and type it into a Javascript terminal (like on Chrome developer tools), everything works.</p>
<pre><code> function loadController(name){
clearAll();
scriptContainer.innerHTML = '';
var scriptElement = document.createElement('script');
scriptElement.setAttribute('src','controllers/' + name + '.js');
scriptElement.setAttribute('type','text/javascript');
scriptContainer.appendChild(scriptElement);
controllerStart();// <-- Doesn't work from here, but works on a terminal
}
</code></pre>
<p>Thanks for taking a look!</p>
| javascript | [3] |
4,569,113 | 4,569,114 | javascript dynamic prototype | <p>I want extend a new JS object while creation with other object passing a parameter.
This code does not work, because I only can extend object without dynamic parameter.</p>
<pre><code>otherObject = function(id1){
this.id = id1;
};
otherObject.prototype.test =function(){
alert(this.id);
};
testObject = function(id2) {
this.id=id2;
};
testObject.prototype = new otherObject("id2");/* id2 should be testObject this.id */
var a = new testObject("variable");
a.test();
</code></pre>
<p>Any suggestion?</p>
| javascript | [3] |
1,236,808 | 1,236,809 | What is the relationship of .lib and .obj to each other and my project in c++? | <p>What are how do .lib and .obj files relate to each other? What is their purpose? Is a .lib just a collection of .obj files? If so are the .obj's then stored inside the .lib making the .obj's unnecessary? </p>
| c++ | [6] |
4,541,854 | 4,541,855 | How can I populate a menu using intents? | <p>How can I populate a menu using <a href="http://developer.android.com/guide/topics/intents/intents-filters.html" rel="nofollow">intents</a>? I didn't understand that thing.</p>
<p>Or is there any better way for that?</p>
<h3>Update:</h3>
<p>Suppose I have an application that need to resize the image,and there are many other applications that have a capability of resizing the image. How can I show the list of applications on a menu in my application so that when clicking on a particular option it will invoke the intent associated with that application. Simply saying I could resize the image in my application with out bothering about how that will get done.</p>
| android | [4] |
2,562,554 | 2,562,555 | Where to put common shared methods | <p>I have a bunch of methods that are commonly used everywhere. Right now the codefile is named globals, to represent the fact that they are... in fact... global.</p>
<p>However, I do not like this.</p>
<p>I want to group these into a class and pass an interface around. I'll make only one instance, but I'm not falling into the singleton trap here.</p>
<p>First of all, what should I name the class. I want to avoid the globals name because I'm afraid maintainers would get the wrong idea.</p>
<p>Also, how should I consider splitting up such a set of methods so that behavior can change and adapt?</p>
<p>The set of methods contains stuff like:</p>
<ul>
<li>Conversion tables</li>
<li>Clipboard interaction</li>
<li>Managing built fonts</li>
<li>Common drawing methods</li>
<li>Providing an interface with access to often used resources</li>
</ul>
| c# | [0] |
2,493,605 | 2,493,606 | Variable doesn’t exist in current context | <p>I've got a rather odd situation which is bound to something breathtakingly obvious, but it has me stumped.</p>
<p>Quite simply, I'm trying to load some configuration data into my app, as follows:</p>
<pre><code>namespace XMLGrabberCS
{
class Grabber
{
public static void Main()
{
string test = "test";
string serverName = ConfigurationManager.AppSettings["ServerName"];
try
{
//do stuff...
</code></pre>
<p>Pretty straightforward stuff, except that if you query (i.e. via Quick Watch) either variable, you get a <code>variable doesn’t exist in current context</code> error.</p>
<p>If you watch <code>ConfigurationManager.AppSettings["ServerName"]</code> it does return the right value...</p>
<p>What on earth is going on here?</p>
| c# | [0] |
4,844,680 | 4,844,681 | MRAID file reference | <p>The IAB MRAID specification
<a href="http://www.iab.net/media/file/IAB_MRAID_VersionOne_final.pdf" rel="nofollow">http://www.iab.net/media/file/IAB_MRAID_VersionOne_final.pdf</a></p>
<h2>Says that a reference to an mraid.js file should be the first line within an MRAID compliant ad</h2>
<p>MRAID script reference
The MRAID comment follows HTML Javascript syntax so that both fully formed web pages and
HTML fragments can be identified as MRAID ads.</p>
<hr>
<p>Which is ok. But I am being convinced by some CTO that it is OK for the mraid.js to not exist. Surely it must exist and contain some function call for confirmation of the existence of the MRAID function requests or initialise the MRAID namespace.</p>
| javascript | [3] |
1,310,598 | 1,310,599 | Scale Animation on an EditText .. help | <p>i'm trying to animate an EditText when i touch it using scale animation , i managed to do that by creating my own editText (extends EditText) .The animation works , but after it the EditText size(width) does not change it still the same . How can i change that ? I tried to call
this.setWidth() after the animation , but it does not work so well. Which is the best approach for my problem ?</p>
<pre><code>@Override
public boolean onTouchEvent(MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
focus = true;
this.setText("");
this.setTextColor(Color.parseColor("#000000"));
if (firstTime) {
animate();
}
break;
case MotionEvent.ACTION_UP:
text = this.getText().toString();
break;
}
return super.onTouchEvent(event);
}
private void animate() {
Log.i("teste", "ed width: " + this.getWidth());
Log.i("teste", "parent width: " + parent.getWidth());
float x = ((float) parent.getWidth() / this.getWidth());
Log.i("teste", "x: " + x);
ScaleAnimation sc = new ScaleAnimation(1, x, 1, 1, 0.5f, 0.0f);
sc.setStartOffset(100);
sc.setInterpolator(new AccelerateInterpolator());
sc.setFillAfter(true);
sc.setDuration(1000);
this.startAnimation(sc);
invalidate();
firstTime = false;
}
</code></pre>
| android | [4] |
3,628,843 | 3,628,844 | C++ const member functions | <p>I have a syntax error that is puzzling</p>
<p>Previous code:</p>
<pre><code>class A {
public:
void process(const string& str) {};
};
</code></pre>
<p>I have </p>
<pre><code>A a;
a.process("abcd");
</code></pre>
<p>all is well
now I change the process member function to a const</p>
<pre><code>void process(const string& str) const {};
</code></pre>
<p>and now
<code>a.process("abcd");</code> get a compile error about str being a const char[5]...</p>
<p>How the const addition impact the syntax error. I thought const only (in this context) meant that the member variables will not change?</p>
<p>Thoughts on this?</p>
| c++ | [6] |
3,576,590 | 3,576,591 | Better cout a.k.a coutn; | <p>Guys would it be difficult to write coutn which would basically place newline symbol at the end of the input. While working with console (that's all I can do at the moment) I'm finding very tedious to write '\n' every time I want the line to be a new line.<br>
Or maybe it is already implemented?</p>
| c++ | [6] |
4,285,354 | 4,285,355 | what is php exit doing in function? | <p>Hi I have this function</p>
<pre><code>function fail($pub, $pvt = '')
{
global $debug;
$msg = $pub;
if ($debug && $pvt !== '')
$msg .= ": $pvt";
$_SESSION['msg'] = $msg;
header ("Location: /voting/");
exit;
}
</code></pre>
<p>The page should redirect before it gets to the exit command right? Without the exit command however the function doesn't work correctly (it continues on even though it should have redirected). If anyones knows could you explain why the code continues on if the function did not exit even though in both cases it will redirect?</p>
| php | [2] |
4,258,165 | 4,258,166 | How to make my class enabled to cast for Integer | <p>I have a doubt on how to cast my class to <code>Integer</code>. Example:</p>
<pre><code>public class IntegerField extends Field {
private Integer value;
public IntegerField(Integer value) {
super();
this.value = value;
}
public int intValue() {
return value;
}
}
</code></pre>
<p>How can I make:</p>
<pre><code>IntegerField a = new IntegerField(8);
Integer b = (Integer) a;
</code></pre>
<p>Thanks! </p>
| java | [1] |
5,974,391 | 5,974,392 | How do I create a user profile in ContactsContract? | <p>I am trying to create a user profile in ContactsContract...because there is not one, and I need one for testing. I don't have a real-life Android device, and only have the AVD Emulator for testing.</p>
<p>Here is the code block that I am working from:</p>
<pre><code>ArrayList<ContentProviderOperation> ops = new ArrayList<ContentProviderOperation>();
ops.add(ContentProviderOperation.newInsert(RawContacts.CONTENT_URI)
.withValue(RawContacts.ACCOUNT_TYPE, null)
.withValue(RawContacts.ACCOUNT_NAME, null)
.build());
ops.add(ContentProviderOperation.newInsert(Data.CONTENT_URI)
.withValueBackReference(Data.RAW_CONTACT_ID, 0)
.withValue(Data.MIMETYPE, Profile.CONTENT_RAW_CONTACTS_URI)
.withValue(Profile.IS_USER_PROFILE, 1)
.build());
ops.add(ContentProviderOperation.newInsert(Data.CONTENT_URI)
.withValueBackReference(Data.RAW_CONTACT_ID, 0)
.withValue(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE)
.withValue(StructuredName.DISPLAY_NAME, name)
.build());
this.getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);
</code></pre>
<p>If you remove the lines for making this entry a user profile, it works fine (i.e., will insert the name). However, I can not figure out how to set the entry with the IS_USER_PROFILE flag.</p>
<p>Can you create a user profile from an App? If so, any ideas on why this won't work?</p>
<p>Many thanks!
Scott</p>
| android | [4] |
2,298,129 | 2,298,130 | scriptdata not working in uploadify | <p>Hi Friends i am using uploadify for my project.. in that i need to pass some data to upload.php to insert it in database. i am using the below code for sending data and getting it using $_POST in that upload.php file but its not getting those values.</p>
<pre><code> $("#fileupload").fileUpload({
'uploader': 'uploadify/uploader.swf',
'cancelImg': 'uploadify/cancel.png',
'script': 'uploadify/upload.php',
'scriptData' : {'name':'name','status':1}
</code></pre>
<p>Can anyone help me on this ..</p>
| php | [2] |
5,877,922 | 5,877,923 | session not working | <p>I am using SQL express 2008 and visual studio 2010.</p>
<p>I made a simple login form using session. I want that if the session is null the user shouldn't be able to go to the desired page. I have written the following code:</p>
<pre><code>public void btnsubmit_CLICK(object sender, EventArgs e)
{
if (TextBox1.Text =="admin" && TXTID.Text =="admin")
{
Session["user"] = "admin";
Response.Redirect("generate_report.aspx");
}
else
{
lblmsg.Text = "user name Or password is not correct!";
}
</code></pre>
<p>NEXT PAGE:</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
if (Session["user"] != "admin")
{
Response.Redirect("Default.aspx");
}
</code></pre>
<p>It is working fine if I use it locally but when I load it on the client server it doesn't work at all. Why is so?</p>
| c# | [0] |
3,063,014 | 3,063,015 | python program error | <p>ankit@ubuntu:~/Desktop$ python binary_light.py Could you please tell me where I am doing mistake?? Since I am using your files and have not changed anything in it.</p>
<pre><code>Error:
Traceback (most recent call last):
File "binary_light.py", line 8, in <module>
from brisa.upnp.device import Device, Service
File "/usr/local/lib/python2.6/dist-packages/brisa/upnp/device/__init__.py", line 8, in <module>
from brisa.upnp.device.device import Device
File "/usr/local/lib/python2.6/dist-packages/brisa/upnp/device/device.py", line 10, in <module>
from brisa.core import log, config, webserver, network
File "/usr/local/lib/python2.6/dist-packages/brisa/core/webserver.py", line 39, in <module>
raise RuntimeError('Network is down.')
</code></pre>
<p>RuntimeError: Network is down.</p>
| python | [7] |
1,718,217 | 1,718,218 | what's the code meaning? | <pre><code>$file = fopen("test.txt","r");
while($line = fgets($file)) {
$line = trim($line);
list($model,$price) = preg_split('/\s+/',$line);
if(empty($price)) {
$price = 0;
}
$sql = "UPDATE products
SET products_price=$price
WHERE products_model='$model'";
// run the sql query.
}
fclose($file);
</code></pre>
<p>the txt file like this:</p>
<pre><code>model price
LB2117 19.49
LB2381 25.99
</code></pre>
<p>1, what's the meaning of <code>list($model,$price) = preg_split('/\s+/',$line);</code>
i know <code>preg_split</code> like <code>explode</code>, but i don't know what't the parameter meaning of the above line
2, how to skip the first record.</p>
| php | [2] |
2,631,373 | 2,631,374 | RuntimeException in AsyncTask | <p>I am using <code>AsyncTask</code> for a long running task but I am getting the following error.</p>
<pre><code>error in doInBackground====java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
</code></pre>
<p>Why am I getting that error and what does it mean?</p>
| android | [4] |
4,713,059 | 4,713,060 | Virtual keyboard issue in android | <p>In my android application i would like to use a Linearlayout at the bottom of the parent and just above that a scrollview with a edittext in it.
when a touch on the edittext a virtual keyboard pops up with both edittext and linearlayout aligned at the bottom.
I would like to view only the edittext and not the footer linearlayout on the top.</p>
<p>Is there anyway that i can get it done in android.</p>
<p>Please share your valuable suggestions.</p>
<p>Thanks in advance :)</p>
| android | [4] |
5,548,824 | 5,548,825 | How to download pdf files in python? | <p>I need to download something like</p>
<pre><code>str = 'http://query.nytimes.com/mem/archive-free/pdf?res=9A00EEDE1431E13BBC4850DFBF66838A649FDE'
url = urllib2.urlopen(str)
file = open('test.pdf', 'w')
file.write(url.read())
file.close()
</code></pre>
<p>It just creates a wrong pdf.</p>
<p>how do I write that into file?</p>
| python | [7] |
4,426,031 | 4,426,032 | How to select a certain text from text file and enter into text box | <p>Hi all
I have a sql script in text file which is as follows</p>
<pre><code>create view [dbo].[budget_change-22]
as select projectname, projectnumber,location, client
FROM OPENROWSET('SQLNCLI', 'SERVER=AABB1089\abcWORKSS_STO;UID=abcworkss;PWD=abcdef,
'SET NOCOUNT ON;SET FMTONLY OFF;EXEC abcworks_sto..SP_Budget_444 38') AS Workchanged_444
Go
</code></pre>
<p>Now in the above script i have to select Server value (AABB1089\abcWORKSS_STO), UID value(abcwork), Pwd value(abcdef) so that i can replace in text box and edit them to create a new text file with different name.</p>
| c# | [0] |
699,799 | 699,800 | Strings in Java | <p>I have a code:</p>
<pre><code>for(int i=0;i<fList.size();i++){
String targets="";
String values="";
String sql="INSERT INTO "+tableName+"("+targets+") VALUES("+values+")";
Map<Column, String> attrs=fList.get(i).getAttributes();
for(int j=0;j<columns.size();j++){
if(columns.get(j).getName().equalsIgnoreCase("kadnum")){
targets=targets+"kadnum,";
System.out.println("targets:"+targets);
values=values+attrs.get(columns.get(j))+",";
System.out.println("values:"+values);
}
if(columns.get(j).getName().equalsIgnoreCase("support_num")){
targets=targets+"support_num";
values=values+attrs.get(columns.get(j))+",";
}
}
System.out.println("sql="+sql);
}
</code></pre>
<p>And get out put:</p>
<pre><code>INSERT INTO parcels () VALUES()
</code></pre>
<p>But if u change <code>System.out.println("sql="+sql);</code> to <code>System.out.println("targets="+targets);</code> i get : <code>targets=kadnum,</code>
Why string sql not change?</p>
| java | [1] |
1,586,455 | 1,586,456 | Asp.Net one page with minimal markup to different code behind classes | <p>I have an aspx page which has minimal markup created at design time.
The majority of the page is generated dynamically based on a querystring parameter.
In then end, I will have hundreds of these "dynamic" pages.
What I want to do is have one aspx page which branches out to different code behind classes based on the querystring parameter.</p>
<p>Basically, the single aspx page just serves as entry point to a dynamically generated interface. For example :</p>
<p>dynamicpage.aspx?screen=AddEmployee would dynamically generate an edit form to add an employee
dynamicpage.aspx?screen=EditStudents&Id=1 would dynamically generate an edit form to edit a student record
dynamicpage.aspx?screen=ListEmployees would dyanmically generate a form to list employees
...</p>
<p>All the controls on the page are generated dynamically based on an external form definition xml file. That part I have done and works perfectly.</p>
<p>So, I would like to have a seperate code behind (class) for each case (to handle specific events).</p>
<p>Is this possible ?</p>
| asp.net | [9] |
4,238,546 | 4,238,547 | datetime checking for specific time | <p>I have a windows service and I would like to insert a timer. How can I check if the present time is <code>9:00 AM</code> ?
I would like my service to check this every day. Thank you a lot</p>
<p>My try:</p>
<pre><code>Datetime dt=Datetime.parse("09:00:00 everyday");
if(datetime.now -dt ==0)
{
//fire event
}
</code></pre>
<p>Thats kinda sily of me though.</p>
| c# | [0] |
2,090,637 | 2,090,638 | Use if else conditions with shortcuts | <p>Below is my codes: </p>
<p>Code 1:</p>
<pre><code>int x = 10;
if (x < 10)
{
if (x < 5)
{
MessageBox.Show("less than 5");
}
else
{
MessageBox.Show("value is between 5 and 10");
}
}
else
{
MessageBox.Show("grater than 10");
}
</code></pre>
<p>Code 2:</p>
<pre><code>int x = 10;
if (x > 5 && x < 10)
{
MessageBox.Show("Value is between 5 and 10");
}
else if (x < 5)
{
MessageBox.Show("less than 5");
}
else
{
MessageBox.Show("grater than 10");
}
</code></pre>
<p>How can I write this code using inline if conditions.</p>
| c# | [0] |
4,961,746 | 4,961,747 | JQuery giving different access to tags when using this | <p>I'm new to JQuery and have a script that creates a dialog via Ajax using the HREF and TITLE tags of an link. The problem is, I can easily pull the HREF tag out of "this", but the same doesn't apply at all to the TITLE tag. In the following example, why does an alert correctly appear with the HREF, but not with the TITLE?</p>
<pre><code><script>
$(function (){
$('a.ajax').click(function() {
var href = this.href;
alert(href);
var title = this.title;
alert(title);
return false;
});
});
</script>
<a class="ajax" title="A nice title" href="test.html">Click me!</a>
</code></pre>
<p>I konw I'm missing something small... I've already tried "var title = $(this).title;" and "var title = $(this).attr('title');" and other similar variations, but none get the title.</p>
| jquery | [5] |
709,626 | 709,627 | a in-class class access the outer class's data member | <p>I was trying to do this,</p>
<pre><code>class Outer {
public:
struct inner_t {
void foo()
{
printf("%d", _x);
}
};
int _x;
};
int main()
{
Outer o;
o._x = 10;
}
</code></pre>
<p>The above can't compile with errors:</p>
<blockquote>
<p>error: invalid use of non-static data member ‘Outer::_x’</p>
</blockquote>
<p>But according to <a href="http://stackoverflow.com/a/8870002/888051">this post</a>, <code>inner_t</code> can indeed access <code>Outer::_x</code>, what's wrong?</p>
| c++ | [6] |
1,788,435 | 1,788,436 | Java Type mismatch - cannot convert from int[][] error in constructor | <p>my constructor is</p>
<pre><code>public class Figure{
int[][] x;
Color y;
public Figure(int[][] x , Color y){
this.x=x;
this.y=y;
}
</code></pre>
<p>and i am initializing object in the following way:</p>
<pre><code>Figure s = new Figure({{0,1,1},{1,1,0}},Color.ORANGE);
</code></pre>
<p>getting the following error:</p>
<p>Type mismatch - cannot convert from int[][] to Figure
Syntax error on tokens: misplaced construct
Variable declarator expected instead</p>
| java | [1] |
2,790,974 | 2,790,975 | Failed to load Main-Class manifest attribute from external library | <p>I am using the postgresql driver to connect to a sql server with java.<br>
It is contained in a jar file that i downloaded form there website. </p>
<pre><code>java -classpath /home/asdf/myProgram;/home/asdf/myProgram/lib/postgresql-9.2-002.jdbc4.jar myMainClass
</code></pre>
<p>results in an error:
Failed to load Main-Class manifest attribute from /home/asdf/myProgram/lib/postgresql-9.2-002.jdbc4.jar</p>
<p>the main class is in /home/asdf/myProgram/myMainClas.class</p>
<p>how do i get java to check for that before checking in postgresql-9.2-002.jdbc4.jar</p>
| java | [1] |
1,285,446 | 1,285,447 | PHP server problem | <p>I've build a web site that get source code of the link entered by the user using(HTML DOM), then checks the source depending on standards.
the problem is some web sites can't evaluate.
this is <a href="http://awaef.org/index.php" rel="nofollow">My Web Site link</a> you can check from here.</p>
<p>when you enter google URL in the text-box, the web site functionality works successful, but when trying the example <a href="http://www.alwatan.com.sa/Default.aspx" rel="nofollow">http://www.alwatan.com.sa/Default.aspx</a> it doesn't work. no information appear. </p>
<p>can one help me?</p>
| php | [2] |
53,851 | 53,852 | PHP variable replacement | <p>Is there any function which replaces params in a string? Something like this:</p>
<p>Code:</p>
<pre><code>$format_str = "My name is %name."; /* this was set in a
configuration file - config.php */
$str = xprintf($format_str, array('name' => 'Joe', 'age' => 150));
/* above is somewhere in main code */
</code></pre>
<p>The expected value of $str after the operation is:</p>
<pre><code>My name is Joe.
</code></pre>
<p>Update: I am aware of sprintf. But, it would not suffice in this case. I have modified the code to show what is the difference.</p>
| php | [2] |
540,989 | 540,990 | Control 'dgDisplay' accessed from a thread other than the thread it was created on with Parallel.for | <p>I get an error trying to use Parallel.For</p>
<pre><code>for (int i = 0; i <= count; i++)
{
DataGridViewTextBoxColumn columnDataGridTextBox = new DataGridViewTextBoxColumn();
columnDataGridTextBox.Name = fileDataField[i];
columnDataGridTextBox.HeaderText = fileDataField[i];
columnDataGridTextBox.Width = 120;
dgDisplay.Columns.Add(columnDataGridTextBox);
}
</code></pre>
<p>my code with paraller.for</p>
<pre><code>Parallel.For(0, count, i =>
{
DataGridViewTextBoxColumn columnDataGridTextBox = new DataGridViewTextBoxColumn();
columnDataGridTextBox.Name = fileDataField[i];
columnDataGridTextBox.HeaderText = fileDataField[i];
columnDataGridTextBox.Width = 120;
dgDisplay.Columns.Add(columnDataGridTextBox); <<< this error add colums
});
</code></pre>
| c# | [0] |
4,359,121 | 4,359,122 | Video Embede code in Div panel? In Asp.net? | <p>In Web application, i am using datalist control to bind the Embed videos to a <code><div></code> dynamically. They are coming good, but when we click on video in the <code>datalist</code> they are <strong>start to play</strong>. I dont want that, I would like to play the particular video in a popup, and make a non action on that video [div which contain embeded video]. I want to make that div enable <code>false</code>.</p>
<pre><code><asp:DataList ID="DtlstVideos" ToolTip="Click On Video Title" CellPadding="5" CellSpacing="5" runat="server" RepeatColumns="5" RepeatDirection="Horizontal" OnItemCommandXSSCleaned="DtlstVideos_ItemCommand">
<ItemStyle />
<ItemTemplate>
<div id="divVideos" runat="server"><%# Eval("photos") %></div>
<asp:LinkButton ID="lnkVide" CommandName="Click" runat="server" Text='<%# Eval("videotitle") %>' ToolTip="Play" CommandArgument='<%# Eval("id") %>' Font-Bold="true" ForeColor="Blue"></asp:LinkButton>
</ItemTemplate>
</asp:DataList>
</code></pre>
<p>This is the current code, when a user clicks on the <code>LinkButton</code> a popup will fire and the video will play, but when click on div the video is playing in <code>datalist</code> only, is there any solution?</p>
<p><img src="http://i.stack.imgur.com/KQP0U.jpg" alt="enter image description here"></p>
| asp.net | [9] |
4,706,440 | 4,706,441 | How to know name of class in decorator for function-method? | <p>I have a simple timemark-decorator for function:</p>
<pre><code>def dec_timemark(f):
def tmp(*args, **kwargs):
sys.stdout.write(strftime("%d.%m.%Y %H:%M:%S") + ' ' + f.__name__ +
' begin' + "\n" )
res = f(*args, **kwargs)
sys.stdout.write(strftime("%d.%m.%Y %H:%M:%S") + ' ' + f.__name__ +
' end' + "\n" )
return res
return tmp
</code></pre>
<p>typical usage:</p>
<pre><code>class Task():
@dec_timemark
def make_torrent():
sleep(10)
</code></pre>
<p>But how to add to this <code>decorator</code> name of the <code>class</code>? (Not to log: "<code>make_torrent begin</code>", but "<code>Task.make_torrent begin</code>" for example ) ?</p>
| python | [7] |
5,877,506 | 5,877,507 | Find and edit text files via PHP | <p>Let say a text file contain</p>
<blockquote>
<p>Hello everyone, My name is Alice, i stay in Canada.</p>
</blockquote>
<p>How do i use php to find "Alice" and replace it with "John".</p>
<pre><code> $filename = "C:\intro.txt";
$fp = fopen($filename, 'w');
//fwrite($fp, $string);
fclose($fp);
</code></pre>
| php | [2] |
5,246,456 | 5,246,457 | Problem with including a file | <p>i am getting this error</p>
<pre><code>[28-Jan-2011 09:49:03] PHP Warning: require_once(../../includes/database.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in /Applications/MAMP/htdocs/photo/application/php/classes/users.php on line 2
</code></pre>
<p>[28-Jan-2011 09:49:03] PHP Fatal error: require_once() [function.require]: Failed opening required '../../includes/database.php' (include_path='.:/Applications/MAMP/bin/php5.3/lib/php') in /Applications/MAMP/htdocs/photo/application/php/classes/users.php on line 2</p>
<p>The file i would like to include is in </p>
<pre><code>/Applications/MAMP/htdocs/photo/application/includes/database.php
</code></pre>
<p>I am sure the file is there, i have checked, double checked, triple checked
This is the line 2 in users.php</p>
<pre><code>require_once '../../includes/database.php';
</code></pre>
<p>What could be the problem</p>
| php | [2] |
4,333,296 | 4,333,297 | issue with tabindex in c# .net | <p>If you will look at this image:</p>
<p><img src="http://i.stack.imgur.com/eFSat.jpg" alt=".net c# dialog"></p>
<p>The blue numbers represent the tab index property that I have for the controls. My problem is that when I put the focus on the first textbox control and start hitting TAB it goes from index 0 to 1 to 5 and skips the three controls that are in the group box.</p>
<p>How can I set this up so that when I put the focus on the first text box (index 0) and continue to TAB it will cycle straight from controls 0 to 5 without skipping over the controls in the group box?</p>
| c# | [0] |
2,650,523 | 2,650,524 | Positioning graphics or jpanel in the center of the window on resize | <p>In my program I use cardLayout to switch between panels ( each panel is used as a separate class ). One of the panels, lets call it the board, contains graphics. </p>
<p>As I understand the size of the panel is fit to the window size or jframe, so when I resize window jpanel size and graphics in it also change in size. </p>
<p>How I can position graphics in the center of the window when it resizes? Or as I understand how I can position jpanel in the center so the graphics which it contains will be located in the center of the window also?</p>
<p>My graphics I use in program could be the simple square grid ( which is fixed in number of cells ), here's the code, COLS and ROWS are constants while SIZE ( size of a cell ) is adjusted to the size of the window and can be changed:</p>
<pre><code> g.setColor(Color.LIGHT_GRAY);
for( int i = 1; i < COLS; i ++ ){
for( int j = 1; j < ROWS; j ++ ){
g.drawLine(0, j*SIZE, COLS*SIZE, j*SIZE);
g.drawLine(i*SIZE, 0, i*SIZE, ROWS*SIZE);
}
}
</code></pre>
| java | [1] |
4,366,954 | 4,366,955 | How do I ignore UILocalNotification on devices with OS's older than iOS4? | <p>I am using local notifications in a app I'm making.</p>
<p>I use this: </p>
<pre><code>Class myClass = NSClassFromString(@"UILocalNotification");
if (myClass) {
//Local Notification code
}
</code></pre>
<p>To avoid using UILocalNotifications when not supported.</p>
<p>But my app crashes on launch with this error code:</p>
<blockquote>
<p>warning: Unable to read symbols for
"/Library/MobileSubstrate/MobileSubstrate.dylib"
(file not found). dyld: Symbol not
found:
_OBJC_CLASS_$_UILocalNotification Referenced from:
/var/mobile/Applications/FCFFFCB2-A60B-4A8D-B19B-C3F5DE93DAD2/MyApp.app/MyApp
Expected in:
/System/Library/Frameworks/UIKit.framework/UIKit</p>
<p>Data Formatters temporarily
unavailable, will re-try after a
'continue'. (Not safe to call dlopen
at this time.)
mi_cmd_stack_list_frames: Not enough
frames in stack.
mi_cmd_stack_list_frames: Not enough
frames in stack.</p>
</blockquote>
<p>How can i prevent this?</p>
| iphone | [8] |
501,184 | 501,185 | PHP count not working properly | <p>This only returns User doesn't exist.
Im guessing it is the count that is failing but it worked last night, but not sure why it isn't currently working, i have been playing with my code and making it look better but everything else is still functioning and sadly i do not have any back ups. this is basically for reputation on my websites and this is the php file that the add reputation links to, e.g you are on someones profile ([id number 5]) then when you want to give them a reputation you click a link that is reputation.php?good=5
Pastebin link
<a href="http://pastebin.com/HizC9hq2" rel="nofollow">http://pastebin.com/HizC9hq2</a></p>
| php | [2] |
2,811,945 | 2,811,946 | C# error - "Not all code paths return a value" | <p>This is fairly simple method. I use <code>entity framework</code> to get some data and then check some values in a <code>if statement</code>. However right now the method is marked with red.</p>
<p>This is my method:</p>
<pre><code>private bool IsSoleInProduction(long? shoeLastID)
{
if (shoeLastID == null)
{
MessageBox.Show(Resources.ERROR_SAVE,
"Error",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
return false;
}
ISoleService soleService =
UnityDependencyResolver.Instance.GetService<ISoleService>();
List<Sole> entity =
soleService.All().Where(s => s.ShoeLastID == shoeLastID).ToList();
if (entity.Count() != 0)
{
foreach (var items in entity)
{
if (items.Status == 20)
{
return true;
}
else
{
return false;
}
}
}
else
{
return false;
}
}
</code></pre>
<p>What am I missing?</p>
| c# | [0] |
862,856 | 862,857 | How do I format the output of this Python program? | <p>I am trying to figure out how to get these sets of values to line up from left to right (see below).
How could I do this?</p>
<pre><code>def main():
for temp in range(-20, 70, 10):
for windspeed in range(5, 55, 5):
print int(35.74 + (0.6215*(temp)) - (35.75* windspeed**0.16) + (0.4275*(temp)) * (windspeed**0.16)),
print
main()
</code></pre>
<p>Right now the output is vertical</p>
<pre><code>-34
-40
-45
-48
-50
-53
-54
-56
-58
-59
-22
-28
-32
-35
-37
-39
-41
-42
-44
-45
</code></pre>
<p>I want it like this:</p>
<pre><code>-34 -22
-40 -28
-45 -32
-48 -35
-50 -37
-53 -39
-54 -41
-56 -42
-58 -44
-59 -45
</code></pre>
| python | [7] |
2,942,077 | 2,942,078 | Parse error in var_dump | <p>I am getting parse error in following code:</p>
<pre><code><?php
// This:
$a = array( 'color' => 'red',
'taste' => 'sweet',
'shape' => 'round',
'name' => 'apple',
4 // key will be 0
);
$b = array('a', 'b', 'c');
// . . .is completely equivalent with this:
$a = array();
$a['color'] = 'red';
$a['taste'] = 'sweet';
$a['shape'] = 'round';
$a['name'] = 'apple';
$a[] = 4; // key will be 0
$b = array();
$b[] = 'a';
$b[] = 'b';
$b[] = 'c';
// After the above code is executed, $a will be the array
// array('color' => 'red', 'taste' => 'sweet', 'shape' => 'round',
// 'name' => 'apple', 0 => 4), and $b will be the array
// array(0 => 'a', 1 => 'b', 2 => 'c'), or simply array('a', 'b', 'c')
var_dump($a);
echo <br>
var_dump($b);
echo <br>
?>
</code></pre>
<p>PHP Parse error: syntax error, unexpected '<' in /home/ashish/NetBeansProjects/PhpProject1/index.php on line 31</p>
<p>What is wrong in above code?</p>
<hr>
<p>Ok the correct way to put breaks is this.</p>
<pre><code>echo "<br>";
</code></pre>
| php | [2] |
5,680,747 | 5,680,748 | Help writing the output to another file: | <p>Hi here is the program I have:</p>
<pre><code>with open('C://avy.txt', "rtU") as f:
columns = f.readline().strip().split(" ")
numRows = 0
sums = [0] * len(columns)
for line in f:
# Skip empty lines
if not line.strip():
continue
values = line.split(" ")
for i in xrange(len(values)):
sums[i] += int(values[i])
numRows += 1
for index, summedRowValue in enumerate(sums):
print columns[index], 1.0 * summedRowValue / numRows
</code></pre>
<p>I'd like to modify it so that it writes the output to a file called Finished. I keep getting errors when I rewrite. Can someone help please?</p>
<p>Thanks</p>
| python | [7] |
1,936,506 | 1,936,507 | label region in bi-level image with python | <p>I want to tag clusters of neighboring pixels from a 2D binary matrix in python.
Basically, I am trying to find something similar to the idl function label_region
<a href="http://star.pst.qub.ac.uk/idl/LABEL_REGION.html" rel="nofollow">http://star.pst.qub.ac.uk/idl/LABEL_REGION.html</a>
Do you have any advice?
Thanks </p>
| python | [7] |
2,304,631 | 2,304,632 | create javascript timestamp from innerhtml string values | <p>I'd like to create a javascript timestamp based on a rails date_select and time_select property. I attached an onChange function to the select helper and fetching the innerhtml to read the values into a div which works fine. Now I want to use those strings from the select property and create a timestamp in js (using it for validations).</p>
<p>I did first try this by making integers from the innerhtml values:</p>
<pre><code>function insertText10()
{
var start_day = document.new_link['link[start_at(3i)]'];
var start_month = document.new_link['link[start_at(2i)]'];
var start_year = document.new_link['link[start_at(1i)]'];
var start_hour = document.new_link['link[start_at(4i)]'];
var start_minute = document.new_link['link[start_at(5i)]'];
var selOption1 = start_day[start_day.selectedIndex];
var selOption2 = start_month[start_month.selectedIndex];
var selOption3 = start_year[start_year.selectedIndex];
var selOption4 = start_hour[start_hour.selectedIndex];
var selOption5 = start_minute[start_minute.selectedIndex];
start_date = new Date(parseInt(selOption3.innerHTML),parseInt(selOption2.innerHTML),parseInt(selOption1.innerHTML),parseInt(selOption4.innerHTML),parseInt(selOption5.innerHTML),0,0);
</code></pre>
<p>then by using strings:</p>
<pre><code>start_date = new Date(selOption3.innerHTML+selOption2.innerHTML+selOption1.innerHTML+selOption4.innerHTML+selOption5.innerHTML);
</code></pre>
<p>but neither works.
What am I doing wrong?</p>
<p>--
PS: I checked the w3s docu <a href="http://www.w3schools.com/jsref/jsref_obj_date.asp" rel="nofollow">http://www.w3schools.com/jsref/jsref_obj_date.asp</a> to find the solution above.</p>
| javascript | [3] |
5,371,110 | 5,371,111 | installing Java 5 SDK on Windows Server 2008 R2 64 bit | <p>I have an Hp/Compaq laptop, intel, 2 processors, using 64 bit.
I want to install Java 5 SDK, I see references to AMD 64 bit, I am assuming that is different from intel?
Is there a Java 5 sdk for my environment?</p>
| java | [1] |
4,493,403 | 4,493,404 | simple python list problem | <p>According to the docs:</p>
<pre><code>list.append(x): Add an item to the end of the list
</code></pre>
<p>So, if I do:</p>
<pre><code>list = []
list.append("banana")
print list[0] --> which is suppose to print the FIRST item of the list
> banana
</code></pre>
<p>So far so good, however if now I append another item:</p>
<pre><code>list.append("apple")
print list[0]
</code></pre>
<blockquote>
<p>apple</p>
</blockquote>
<p>Wasn't it suppose to append to the END of the list? How do I keep the order of the list when appending? How should I print the first and last items of the list -- in the order they were added to it?</p>
<p>Thanks</p>
| python | [7] |
1,144,630 | 1,144,631 | Should i use public/private key encryption in this case? | <p>I have an iPhone app and a backend php web app.</p>
<p>The php site stores some information and i have to use the iPhone app to retrieve that data and show it in it.</p>
<p>So, suppose the iphone app has to show a list of houses for a given user, it would call the folllowing php script</p>
<p><a href="http://example/process.php?user=300" rel="nofollow">http://example/process.php?user=300</a></p>
<p>That script makes the sql query and returns an xml with the houses' data.</p>
<p>Should i at any point encrypt anything to prevent spoofing?</p>
<p>Another case, for example admob for each app generates a "publisher id" that is used in the iphone app to "connect" the app with the web app, is that "publisher id" used as a private key to encrypt/decrypt the data sent/received?</p>
<p>Thanks</p>
| iphone | [8] |
401,075 | 401,076 | Python - use lists instead of strings? | <p><a href="http://stackoverflow.com/questions/1228299/change-one-character-in-a-string-in-python">From an S.O answer</a>:</p>
<p>"Don't modify strings.</p>
<p>Work with them as lists; turn them into strings only when needed.</p>
<p>... code sample ...</p>
<p>Python strings are immutable (i.e. they can't be modified). There are a lot of reasons for this. Use lists until you have no choice, only then turn them into strings."</p>
<p>Is this considered best practice? </p>
<p>I find it a bit odd that Python has methods that return new modified strings (such as upper(), title(), replace() etc.) but doesn't have an insert method that returns a new string. Have I missed such a method?</p>
<p>Edit: I'm trying to rename files by inserting a character:</p>
<pre><code>import os
for i in os.listdir('.'):
i.insert(3, '_')
</code></pre>
<p>Which doesn't work due to immutability. Adding to the beginning of a string works fine though:</p>
<pre><code>for i in os.listdir('.'):
os.rename(i, 'some_random_string' + i)
</code></pre>
<p>Edit2: the solution:</p>
<pre><code>>>> for i in os.listdir('.'): │··
... os.rename(i, i[:4] + '_' + i[4:])
</code></pre>
<p>Slicing certainly is nice and solves my problem, but is there a logical explanation why there is no insert() method that returns a new string? </p>
<p>Thanks for the help.</p>
| python | [7] |
5,900,754 | 5,900,755 | Unable to store value in stack | <p>In this code, the <code>subKeys</code> has some values which is extract from cookie, the message prompt <code>cval: 3</code> but I could not push store each <code>subKeys</code> values into <code>stack</code> array which is the <code>stack</code> is always empty.</p>
<pre><code>var stack = new Array();
var temp = document.cookie;
//alert("cookie: "+temp);
function upSelect() {
temp = temp.replace("tutorSelect=","");
subKeys=temp.split(",");
for(var i=0;i<subKeys.length;i++) {
alert("cval: "+subKeys.length);
//push to stack?
stack.push(String(subKeys[i]));
alert("stack: ",stack.length);
document.getElementById("t"+subKeys[i]).src="tta/rem.png";
}
}
</code></pre>
| javascript | [3] |
2,064,269 | 2,064,270 | How to use ColorDrawable with ImageView? | <p>I have a layout with an ImageView defined like:</p>
<pre><code><ImageView
android:layout_width="45dip"
android:layout_height="45dip"
android:scaleType="fitXY" />
</code></pre>
<p>now I just want to set the imageview to be a static color, like red or green. I'm trying:</p>
<pre><code>ColorDrawable cd = new ColorDrawable("FF0000");
cd.setAlpha(255);
ImageView iv = ...;
iv.setImageDrawable(cd);
</code></pre>
<p>the imageview is just empty though, no color. The 45dip space is being used up though. What do I need to do to get the color to be rendered?</p>
<p>Thanks</p>
| android | [4] |
2,219,453 | 2,219,454 | Ban domain extentions buddypress | <p>can someone please help me out, I am using Buddypress/wordpress and i want to ban some domain extensions e.g .pl, .ru, .asia. i have tried the following functions which works for email domain but not extensions.</p>
<pre><code>function my_bp_ban_domains( $result ) {
$banned = array('.ru', '.pl');
$error = 'God catch you brah !!!, Spammers are not welcome here, try your luck elsewhere.';
$email = $result['user_email'];
$domain = array_pop(explode('@', $email));
if ( in_array($domain, $banned)) {
$result['errors']->add('user_email', __($error, 'my_bp_ban_domains' ) );
};
return $result;
}
add_filter( 'bp_core_validate_user_signup', 'my_bp_ban_domains' );
</code></pre>
<p>Thanks</p>
| php | [2] |
3,302,605 | 3,302,606 | weird slowness in asp.net web app - VS 2008 | <p>I compiled my app in release mode. I then went ahead and 'published' the site.</p>
<p>Copies all files and moved them to a staging server with a static ip. Restarted IIS.</p>
<p>Went to another machine and hit my web site. It took about 4 seconds for just the default page, which is pure HTML with no custom framework usage, to show up. What gives???</p>
| asp.net | [9] |
1,394,710 | 1,394,711 | Using htmlentities with BBCode | <p>What I am trying to achieve is a sound method for using BBCode but where all other data is parsed through htmlentities(). I think that this should be possible, I was thinking along the lines of exploding around [] symbols, but I thought there may be a better way.</p>
<p>Any ideas?</p>
| php | [2] |
2,398,375 | 2,398,376 | Python iterable map, range, etc | <p>Why doesn't python have a <code>__future__</code> library that replaces <code>map</code> with <code>imap</code>, <code>range</code> with <code>xrange</code>, etc.? Is it possible to write one?</p>
| python | [7] |
5,902,795 | 5,902,796 | python 'is not' operator | <p>i notice there is a comparison operator 'is not', shall i literally translate it into </p>
<pre><code>!=
</code></pre>
<p>instead of </p>
<pre><code>== not
</code></pre>
<p>thanks</p>
| python | [7] |
3,221,435 | 3,221,436 | jQuery Tabs - Populate Tab Panel with URL content | <p>I need help regarding jQuery Tabs.</p>
<p>I have following code that prints tabs</p>
<pre><code><html>
<head>
<title>jQuery UI URL Tabs</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.8.3.js"></script>
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
</head>
<script>
$(function() {
$( "#myTabs" ).tabs();
});
</script>
<body>
<div id="myTabs">
<ul>
<li><a href="#t1">Page 1</a></li>
<li><a href="#t2">Page 2</a></li>
</ul>
<div id="t1"></div>
<div id="t2"></div>
</div>
</body>
</html>
</code></pre>
<p>I want to load content of tabs dynamically with URL for example
t1 = <a href="http://www.google.co.in" rel="nofollow">http://www.google.co.in</a>
t2 = <a href="http://www.yahoo.com" rel="nofollow">http://www.yahoo.com</a></p>
<p>Can anybody please help?</p>
<p>Thank You.</p>
| jquery | [5] |
2,654,003 | 2,654,004 | TextView setTextColor is ignored when LinearLayout android:background is set | <p>The code is at the very bottom. I can change the color of the text [android:id="@+id/vonage_login_status"] by running </p>
<pre><code>vonage_login_status.setTextColor(this.getResources().getColor(R.color.light_grey));
</code></pre>
<p>However, I want a different colored background, so I added the line <code>android:background="@color/background</code>
But after I added the line, the setTextColor method is being ignored. Any ideas how do I fix it?</p>
<p>Thanks for reading....</p>
<pre><code> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/background"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
android:gravity="center_vertical">
<LinearLayout
android:id="@+id/vonage_login_status_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:clickable="true">
<TextView
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_gravity="center"
android:id="@+id/vonage_login_status"
android:layout_weight="1"
android:gravity="left"
android:singleLine="true"
android:ellipsize="end"
android:padding="0px">
</TextView>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</code></pre>
| android | [4] |
4,186,925 | 4,186,926 | php - not loading variable into the database | <p>I have a database table - serial (autoincrement primary key), version, and turk_number. I am using the following code to insert a new row. I am receiving these variables via $_GET and I did a printout so I know that the variables are available, so I'm not sure whats wrong. The serial and version are loaded in, but not the turk_number.</p>
<pre><code>$turk_number ='';
$serial='';
$version='';
if(isset($_GET['serial']))
{
$serial=$_GET['serial'];
$_SESSION['serial'] = $serial;
}
if(isset($_GET['version']))
{
$version = $_GET['version'];
$_SESSION['version'] = $version;
print "version=" . $version;
}
if(isset($_GET['turk_number']))
{
$turk_number= $_GET['turk_number'];
$_SESSION['turk_number'] = $turk_number;
print "turk number=".$turk_number;
}
//this assigns a participant a unique serial id at the beginning of the game
$hostname = "localhost";
$username = "root";
$password = "";
$dbname = "resolver";
try
{
print 'turk2=' . $turk_number;
$dbh = new PDO("mysql:host=$hostname;dbname=$dbname", $username, $password);
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$query2 = "INSERT INTO participants (version, turk_number) VALUES (:version, :turk_number)";
$stmt = $dbh ->prepare($query2);
$stmt ->execute(array(':version' => $version,
':turk_number' => $turk_number));
}
catch(PDOException $e)
{
echo $e->getMessage();
}
</code></pre>
| php | [2] |
985,932 | 985,933 | Why am I endlessly appending a String in Java | <p>I was writing a game, and when I try to send a chat message to the server, I get an odd memory leak.
Sending string:
!chat¥Test
Turns into:</p>
<pre><code>!chat¥test
!chat¥!chat¥test
!chat¥!chat¥!chat¥test
!chat¥!chat¥!chat¥!chat¥test
!chat¥!chat¥!chat¥!chat¥!chat¥test
!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥test
!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥test
!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥test
!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥test
!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥test
!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥!chat¥test
Ect, ect.
Sending message:
Utils.sendChat(message.getText());
public static void sendChat(String s) {
System.out.println(s);
sendChat("!chat"+Wrapper.commandSplit+s);
}
public static void sendTextLine(String s){
s = s.replace(" ", "[SPACE]");
System.out.println(s);
Wrapper.pw.write(s);
Wrapper.pw.flush();
}
</code></pre>
<p>I have no Idea why this is happening, can somebody help me?
I use the '¥' to split variables in the string, and has not given me any issues before, so I doubt it has anything to do with it.</p>
<p>Thanks.</p>
| java | [1] |
2,304,733 | 2,304,734 | Example or tutorial to deal with didRecieveWarning in iPhone | <p>I want to know if there is any tutorial provided by apple people or any blog where I can learn how to deal with memory and view releasing when you get didRecieveWarning in iPhone.</p>
| iphone | [8] |
301,906 | 301,907 | Comparison of Pojo class properties | <p>I have a class containing two properties:</p>
<pre><code>public class player{
public player(String playerName,int points){
this.playerName=playerName;
this.points=points;
}
public String getPlayerName() {
return playerName;
}
public void setPlayerName(String playerName) {
this.playerName = playerName;
}
public int getPoints() {
return points;
}
public void setPoints(int points) {
this.points = points;
}
private String playerName;
private int points;
}
</code></pre>
<p>I have arrayList class contains collection of palyer objects.</p>
<pre><code>List palyers=new ArrayList();
players.add(new player("mike",2));
players.add(new player("steve",3));
players.add(new player("jhon",7));
players.add(new player("harry",5);
</code></pre>
<p>Here my question is how to display player names with smallest points difference.</p>
<p>Output:</p>
<pre><code>Based on the example code i written:
Mike and steve is the output
THis way comparison should happen:
mike to steve --> 1
mike to jhon--->5
mike to harry-->3
steve to mike -->1
steve to jhon--->5
steve to harry--->3
jhon to mike-->5
jhon to steve-->4
jhon to harry--->2
harry to mike -->3
harry to steve-->2
harry to jhon -->2
Based on above comparison mike and steve should display
</code></pre>
<p>Any java API to compare the properties?</p>
| java | [1] |
4,155,409 | 4,155,410 | Unable to solve error on map: map<int,Element>::iterator i2=0; | <p>I am trying to run a tool written in C++. Upon compiling, it throws the following error:</p>
<blockquote>
<p>tt_hgraph.cpp: In member function ‘void tt_hgraph::Print_tt_hgraph(char*)’:
tt_hgraph.cpp:774: error: conversion from ‘int’ to non-scalar type ‘std::_Rb_tree_iterator >’ requested</p>
</blockquote>
<p>I have also included a map library. Can anyone help, please?</p>
<p>Thanks in advance.</p>
| c++ | [6] |
4,009,647 | 4,009,648 | How to use particle effects in view based application? | <p>How to use <strong>particle effects</strong> in view based application? </p>
<p>I have created a game using view based application and I want to use a particle effects in my game. But, I don't have any idea about using a particle in view based application. </p>
<p>Please give some/any idea.</p>
| iphone | [8] |
3,120,933 | 3,120,934 | I have a redirect error | <p>I'm working on a simple login form and i have this redirect URL:</p>
<pre class="lang-html prettyprint-override"><code><form method="post" action="/incs/login.php?redirect=<?php echo $_SERVER['PHP_SELF'];?>">
</code></pre>
<p>but when I'm filling the form and hit the submit button I'm redirected to a wrong URL:</p>
<pre class="lang-none prettyprint-override"><code>http://site/incs/login.php?redirect=/admin/index.php
</code></pre>
<p>which it's supposed to be like this:</p>
<pre class="lang-none prettyprint-override"><code>http://site/admin/index.php
</code></pre>
<p>I'm following an old guide and I have looked for this (redirect) function on the internet but I could not find anything. Does this still work now or is it not supported any more?</p>
| php | [2] |
1,083,337 | 1,083,338 | Send value to servlet with javascript | <p>In my JavaScript function I do like this in order to redirect parameters to servlet:</p>
<pre><code>var ids1=document.getElementById("projet").value;
document.location.href("http://localhost:8080/Opc_Web_App/ServletAffectation?ids1="+ids1);
</code></pre>
<p>and in the servlet I do the following to get Value:</p>
<pre><code>String idprojet= request.getParameter("ids1");
System.out.println("le projet selectionné est :" +idprojet);
</code></pre>
<p>the problem that i didn't have the result of System.out.print in my screen; so in other terms the servlet didn't get the parameter.</p>
<p>I can not see the problem until now.
Please help.
Thank you.</p>
| javascript | [3] |
807,136 | 807,137 | How to use selectedIndexedChanged event in dropdown? | <p>In list of dropdown i have added some text and i want that if i select any particular text then it fired selectedIndexedChanged event but its not firing.please tell me how it will fire using C# ?</p>
| asp.net | [9] |
5,181,199 | 5,181,200 | determining if a field exists on a form | <p>I have a form field (a series of checkboxes) that's being created dynamically from a database, so it's possible that the field will not exist on the form (if there are no matching values in the database). I have some code that needs to execute based on whether the field exists, and pull in the values that are selected if it does exist. I can't seem to get javascript to acknowledge that this field exists, though. Here's what I've tried:</p>
<pre><code>function displayAction(){
var f = document.adminForm;
var a = f.action;
if(f.prefix.value!="-") {
a = a + '&task=callExclusionDisplay&prefix=' + f.prefix.value;
}
else {
var exclusions = document.getElementById("exclusions");
if (exclusions != null){
alert("exclusions set");
a = a + '&task=callExclusionCreate&prefix=' + f.prefix.value + '&exclusions=' + exclusions.join();
}
}
alert('after if, action is ' + a);
}
</code></pre>
<p>The code never passes the if statement checking to see if exclusions is not null, even though when I look at the page there are a number of checkboxes named exclusions (with the id also set to exclusions). Is the issue with !=null because it's a group of checkboxes, rather than a single form element? How can I get this to work? If I skip the test for null, the code throws errors about exclusions not being defined if the database doesn't return any matching values.</p>
| javascript | [3] |
1,964,319 | 1,964,320 | reason for program termination before method | <p>Trying to learn why my program terminates prematurely. Runs the gallons to liters conversion method ok but stops there. Does not run the "root" method (purpose of which is to compute square roots for number 1 to 100). I believe this is more an issue of formatting than semantics. Thank you for help.</p>
<pre><code>package gallons.to.liters;
public class converter {
public static void main(String args[]) {
double gallons;
double liters;
gallons = 10;
liters = gallons * 3.7854;
System.out.println("The number of liters in " + gallons + " gallons is " +
liters);
System.out.println();
}
public static void root(String args[]) {
double counter;
double square;
square = 0;
counter = 0;
for(square = 0; square <= 100; square++);
square = Math.sqrt(square);
counter++;
System.out.println("The square root of " + counter + " is " +
square);
}
}
</code></pre>
| java | [1] |
1,305,119 | 1,305,120 | Android Popping off the Activity Stack | <p>In our app, we have Activities A,B,C,D, and E. The user usually goes from A to E.</p>
<p>In Activity E we want to go back to A, and get ride of B,C,D from the stack. We don't want to recreate A from E.</p>
<p>How do I 'pop off' B,C,D from the stack and then return to A ?</p>
| android | [4] |
3,124,215 | 3,124,216 | java.lang.RuntimeException: Unable to start activity ComponentInfo: java.lang.NullPointerException | <p>My app gives me this error when using this onclicklistener</p>
<pre><code>private OnClickListener btn_Config_Onclick = new OnClickListener() {
public void onClick(View v) {
Bundle bundle = new Bundle();
bundle.putString("Name", selected_Name);
bundle.putString("Image", selected_Image);
Intent intent = new Intent(v.getContext(), Configure.class);
intent.putExtras(bundle);
v.getContext().startActivity(intent);
}
};
</code></pre>
<p>The class for configure is here: <a href="http://pastebin.com/njMa9buE" rel="nofollow">http://pastebin.com/njMa9buE</a></p>
<p>and the complete error here: <a href="http://pastebin.com/REemSken" rel="nofollow">http://pastebin.com/REemSken</a></p>
<p>I have been looking over everything and cant for the life of me find whats wrong, everything is correctly defined in the manifest etc.
Hoping fresh eyes will find the issue</p>
| android | [4] |
5,551,166 | 5,551,167 | Determining the size of an Android view at runtime | <p>I am trying to apply an animation to a view in my Android app after my activity is created. To do this, I need to determine the current size of the view, and then set up an animation to scale from the current size to the new size. This part must be done at runtime, since the view scales to different sizes depending on input from the user. My layout is defined in XML.</p>
<p>This seems like an easy task, and there are lots of SO questions regarding this though none which solved my problem, obviously. So perhaps I am missing something obvious. I get a handle to my view by:</p>
<pre><code>ImageView myView = (ImageView)getWindow().findViewById(R.id.MyViewID);
</code></pre>
<p>This works fine, but when calling <code>getWidth()</code>, <code>getHeight()</code>, <code>getMeasuredWidth()</code>, <code>getLayoutParams().width</code>, etc., they all return 0. I have also tried manually calling <code>measure()</code> on the view followed by a call to <code>getMeasuredWidth()</code>, but that has no effect.</p>
<p>I have tried calling these methods and inspecting the object in the debugger in my activity's <code>onCreate()</code> and in <code>onPostCreate()</code>. How can I figure out the exact dimensions of this view at runtime?</p>
| android | [4] |
2,511,094 | 2,511,095 | Problem in connecting IBOutlet | <p>In my application, I am trying to remove all existing subviews and add a new one created in Interface Builder. However, I don't seem to be able to connect the view.</p>
<p>When a button clicks, the following function is executed (inside a subclass of UIViewController): </p>
<pre><code>// Display a list of settings to choose from
- (void) settings
{
SettingsRootController *settingsController = [[SettingsRootController alloc] initWithNibName:@"SettingsRootController" bundle:nil];
_settingsController = settingsController;
for (UIView *view in self.view.subviews)
{
[view removeFromSuperview];
}
[self.view addSubview:_settingsController.view2];
int a = [self.view.subviews count];
[self.view setNeedsDisplay];
......
}
#import <UIKit/UIKit.h>
@interface SettingsRootController : UIViewController
{
IBOutlet UIView *_view2;
}
@property(nonatomic, retain) IBOutlet UIView *view2;
</code></pre>
<p>Inside the Interface Builder, I created a new View-based xib. Set file owner to SettingsRootController. Randomly drag a UITextView into the xib. Connect the UITextView to view and view2 in SettingsRootController.</p>
<p>However, if the above line is:</p>
<pre><code>[self.view addSubview:_settingsController.view2];
</code></pre>
<p>a would always be 0, and thus the new screen is empty.</p>
<p>But if change to:</p>
<pre><code>[self.view addSubview:_settingsController.view];
</code></pre>
<p>I could see the UITextView.</p>
| iphone | [8] |
3,805,303 | 3,805,304 | Html List tag not working in android textview. what can i do? | <p>Html List tag not working in android textview. this is my string content:</p>
<pre><code>String str="A dressy take on classic gingham in a soft, textured weave of stripes that resembles twill. Take a closer look at this one.<ul><li>Trim, tailored fit for a bespoke feel</li><li>Medium spread collar, one-button mitered barrel cuffs</li><li>Applied placket with genuine mother-of-pearl buttons</li><li>;Split back yoke, rear side pleats</li><li>Made in the U.S.A. of 100% imported cotton.</li></ul>";
</code></pre>
<p>I loaded it on text view like this:</p>
<pre><code>textview.setText(Html.fromHtml(str));
</code></pre>
<p>The Output like a paragraph.what can i do? Is there any Solution for it?</p>
<p>Edit:</p>
<pre><code>webview.loadData(str,"texl/html","utf-8");
</code></pre>
| android | [4] |
4,312,438 | 4,312,439 | jquery Selectors | <p>I'm writing a simple code using jQuery, in which I need to call a function for a series of selectors and eliminate some functions being called for a particular selector, for example </p>
<pre><code>$('#id1, #id2, #id3').click(function() {
function1();
function2();
function3();
// rest of my code
});
</code></pre>
<p>I don't wanna call some <strong>functions</strong> for a particular selector and for a particular reason, say I want to call all the functions when I perform click event on selectors like <strong>id1</strong> and <strong>id2</strong> and want to eliminate <strong>function2()</strong> being called when I perform a click event on <strong>id3</strong></p>
<p>Thanks for reading </p>
| jquery | [5] |
81,254 | 81,255 | Independant button | <p>I have a Javascript code that creates buttons OnLoad with the attributes being the values from an ASP page that fetches from the database. But whatever event I want each button to do, all the other buttons do it and it executes before the buttons are displayed. Please help...</p>
<pre><code>function createButtons(tbID, tbClass, tbType, tbValue, onClick) {
return '\n<input'
+ (tbID ? ' id=\'' + tbID + '\'' : '')
+ (tbClass ? ' class=\'' + tbClass + '\'' : '')
+ (tbType ? ' type=\'' + tbType + '\'' : '')
+ (tbValue ? ' value=\'' + tbValue + '\'' : '')
+ (onClick ? ' onclick=\''+ onClick + '\'':'')
+ '>';
}
function DisplayButtons(cableData) {
var newContent = '';
$.each(cableData, function (i, item) {
newContent += createButtons(item.CommonCable, null, "submit", item.CommonCable,alert("clicked"));
});
$('#Categories').html(newContent);
</code></pre>
<p>}</p>
| javascript | [3] |
682,099 | 682,100 | sin inverse in Iphone SDK? | <p>I wanted to calculate sin inverse ..so i did this:</p>
<pre><code> float radians = asinf(1.1205);
NSLog(@"%f",radians);
</code></pre>
<p>Output is something like "nano"....any help?</p>
| iphone | [8] |
1,568,811 | 1,568,812 | cannot find ActivityCreator.bat | <p>I have recently started learning Android development. In the android-sdk/tools folder, there should be a command-line tool named ActivityCreator.bat, right? But I cant find it. Can anyone tell me why is it so? The version of android platform is 2.1</p>
| android | [4] |
5,663,955 | 5,663,956 | python - how can I display a image from web? | <p>I'm using Python to make a "web album viewer", but I meet some problem.</p>
<p>I use Tkinter to write GUI, urllib2 to fetch the image from web, PIL to handle the image</p>
<p>So the code is like this:</p>
<pre><code>root = Tk()
frame = Frame(root)
frame.pack()
response = urllib2.urlopen(a_pic_url)
photo = ImageTk.PhotoImage(Image.open(response.read()))
label = Label(frame, image = photo)
label.pack()
</code></pre>
<p>it fails, and throws the following error message:</p>
<pre><code>TypeError: file() argument 1 must be (encoded string without NULL bytes), not str
</code></pre>
<p>How can I overcome this?</p>
<p>Thanks, and I'm sorry for my poor English.</p>
| python | [7] |
4,920,623 | 4,920,624 | Session variables not being display on particular page | <p>I'm not a PHP developer here.</p>
<p>I have a page that is unable to display session values even though they definitely exist. I am able to view them on another page, yet for some reason they cannot be seen on a certain page!?</p>
<p>EDIT:
Below is the script that exists on the top of the page</p>
<pre><code><?php
require_once('eu_gl.php'); // <- includes session_start() in it
if(!session_id()) session_start(); // added this in case, but should not be needed
?>
</code></pre>
<p>Contents of the include:</p>
<pre><code><?php
/*** Global include file **/
set_time_limit(300);
$time1 = microtime();
define('APP_SESS_NAME', 'EURA');
session_name(APP_SESS_NAME);
session_start();
session_set_cookie_params(0);
//...
?>
</code></pre>
| php | [2] |
2,721,264 | 2,721,265 | Memory address of variables in Java | <p>Please look at the picture below.
When we create an object in java with new keyword, we are getting a memory address from the OS.</p>
<p>I wonder that, when we write <code>out.println(objName)</code> we can see some strings as output.</p>
<ol>
<li>what is this output?</li>
<li>If it is memory address which given by OS to us:
a) How can i convert this string to binary?
b) How can i get one integer variables address?</li>
</ol>
<p><img src="http://content.screencast.com/users/uzay95/folders/Jing/media/f3caf9f8-b109-41d4-a477-0ad7c10504ce/2009-12-25%5F1456.png" alt="alt text"></p>
| java | [1] |
1,609,382 | 1,609,383 | jQuery run a function every 5 seconds in a jsp page | <p>I have a following script in my jsp page that I need to refresh (call) every 5 seconds to refresh the data to be displayed:</p>
<pre><code>$(document).ready(function () {
var sampleData = <%=sms.getTimeline()%>;
...
});
</code></pre>
<p>Can someone please let me know how to do so? </p>
<p>Thanks, </p>
| jquery | [5] |
5,065,322 | 5,065,323 | Writing specific lines of a text file | <p>I write this code:</p>
<pre><code>f = open('example.txt','r')
lines = f.readlines()
for i, line in enumerate(f):
if i < 3:
lines = ['LC '+line for line in lines]
with open('./example.txt', 'w') as f:
f.writelines(lines)
f.close()
elif i < 5:
lines = ['LB '+line for line in lines]
with open('./example.txt', 'w') as f:
f.writelines(lines)
f.close()
elif i > 6:
break
f.close()
</code></pre>
<p>I have a file with 11 lines. I want to write something in the start from every line. The word is different for the 3 first line and different for other 2. Could you help me what am I doing wrong?</p>
| python | [7] |
3,673,822 | 3,673,823 | Updating UI from broadcastreceiver | <p>I'm using the bump android sdk. I have a broadcast receiver and i would like to update some elements from my ui depending on different intent filters. for example </p>
<pre><code>else if (action.equals(BumpAPIIntents.NOT_MATCHED)) {
Log.i("Bump Test", "Not matched.");
BumpTest inst = BumpTest.instance();
if(inst != null) {
inst.UpdateMyText("testing");
}
</code></pre>
<p>Problem is even though in logcat i can see the log entry the textview update method doesnt seem to be called</p>
<p>Am I doing something wrong?</p>
| android | [4] |
4,492,249 | 4,492,250 | Access main site dll's class and create object from sub site in c# | <p>I have one dll in my main project location's bin folder at the server, and i have one sub site under the main site, </p>
<p>i want to refer/access the main site's dll class and create object from my sub site. I will keep my dll's in the main site's bin location only, i dont want to copy the referred dll in the sub site bin folder. </p>
<p>Can any one help how to do this?</p>
| c# | [0] |
2,071,623 | 2,071,624 | How run programm once in python in linux? | <p>I want to write statement, in which I will check runs that script from other place (on that machine) or not?</p>
| python | [7] |
814,777 | 814,778 | Jquery - Focus on an input field in a form on pageload? | <p>I am trying to focus on the username input in my login screen to allow for easier access to logging in and currently my jquery looks like this</p>
<pre><code>$(document).ready(function() {
$('#Username').focus();
});
</code></pre>
<p>but that doesn't work... any ideas?</p>
| jquery | [5] |
2,789,298 | 2,789,299 | The version of xcode that supports Iphone OS 3.1.2(7D11)? | <p>HELLO,
I am working on XCODE 3.1.4 , my iphone have 3.1.2 os...But as this version of xcode supports iphone os3.1.1 and below.. so plz help me as either tell me the newer version of xcode that supports iphone os 3.1.2 or should i downgrade my iphone os to 3.1.1,,</p>
<p>any assistance is really appreciated..</p>
| iphone | [8] |
2,433,183 | 2,433,184 | Need help on setting value fetched from db to list | <p>Friends,
I need to fetch data from SQlite Db and set it on List View,it fetches data has well but the view showing on screen being empty,anybody help me to get the content to visible.</p>
| android | [4] |
1,312,573 | 1,312,574 | How to convert ISOString to local ISOString in javascript? | <p>How to convert ISOString to local ISOString in javascript?</p>
<p>I have <a href="http://en.wikipedia.org/wiki/ISO_8601" rel="nofollow">ISO 8086</a> style string(e.g. '2013-02-18T16:39:17+00:00')</p>
<p>And I want to convert that to local ISO_8601 style string...</p>
<pre><code>'2013-02-18T16:39:17+00:00' -> '2013-02-19T01:39:17+09:00'
</code></pre>
<p>What should I do?</p>
| javascript | [3] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.