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,594,792 | 5,594,793 |
How to calculate/generate a string with all possible values in an array?
|
<p>This is driving me nuts but I've been struggling with this all noon now (im in GMT+2;)).</p>
<p>I want to do a fairly (I believed but realized it turned out otherwise..) simple task.</p>
<p>Lets say I have an array which looks like this:</p>
<pre><code>Array
(
[0] => Array
(
[OptionID] => 8748
[Values] => Array
(
[0] => 11614
[1] => 11615
)
)
[1] => Array
(
[OptionID] => 8749
[Values] => Array
(
[0] => 11616
[1] => 11617
)
)
)
</code></pre>
<p>This array is for generating all possible options with a product. Lets say OptionID 8748 means 'Size' and the Values in that array are 'L' & 'XL'. OptionID 8749 could be 'Color' with Values 'Red' and 'Black'.</p>
<p>I want to achieve the simple task to get the four unique combinations of that product in a string like:</p>
<p>11614+11616
11614+11617
11615+11616
11615+11617</p>
<p>But then, with a different product there could be a third product option, so it should be able to work arround with an unlimited depth.</p>
|
php
|
[2]
|
4,604,866 | 4,604,867 |
jquery divs in an array to display
|
<p>I have an array of <code>DIV</code> ids as following and in <code>CSS</code> they all below to a class with <code>display:none</code>.</p>
<pre><code>var paintDivs = ["div_2ndSubCategoryID","div_3rdSubCategoryID","div_4thSubCategoryID","div_ColorNameID","div_ColorNoID","div_PaintSizeID"];
</code></pre>
<p>Long story short, what I now want is to display all <code>DIV</code>s in <code>paintDivs</code>.</p>
<p>Below is what I have.
Loop iteration is working fine, however the individual <code>DIV</code>s in <code>paintDivs</code> are still not displaying.</p>
<pre><code>jQuery.each(paintDivs, function(idx, valIs){
$('#' + valIs).css('display');
});
</code></pre>
<p>I even tried by creating another class in CSS called, <code>showThis</code> and set <code>display:block</code> and tried to below, still didn't do the trick.</p>
<pre><code>jQuery.each(paintDivs, function(idx, valIs){
$('#' + valIs).attr('class','showThis');
});
</code></pre>
<p>What am I doing wrong? Any insight would be greatly appreciated.</p>
|
jquery
|
[5]
|
3,058,618 | 3,058,619 |
Object reference not set to an instance of an object error though I am instantiationg the object
|
<pre><code> public partial class College
{
public CollegeDetails CollegeDetails;
public List<Students> Students;
public StaffDetails StaffDetails;
}
public partial class Students
{
public StudentDetails StudentDetails ;
public List<Marks> Marks;
}
</code></pre>
<p>in my aspx.cs file</p>
<pre><code> College college = new College ();
Students students= new Students ();
//List<Students> students = new List<Students>;
if (IsValidPost())
{
if (Session["xml"] == null)
{
college.students.Add(new students{ });
Addtogrid();
}
else
{
college = (College)(Session["xml"]);
if (college.students.Count == 0)----getting object refernce erro here
{
college.students.Add(new students{ });
}
Addtogrid();
}
}
else
{
if (Session["xml"] != null)
{
}
</code></pre>
<p>Please help.</p>
|
c#
|
[0]
|
29,938 | 29,939 |
Error Handling URLS that do not exist
|
<p>I'm having problems with handling URLS that do not exist...</p>
<p>In my development environment, I navigated to <a href="http://localhost:XXXX/FakeLocation" rel="nofollow">http://localhost:XXXX/FakeLocation</a> and would catch the HttpException and handle it properly.</p>
<p>When I deployed to my production location, I'm getting a 404 error when I navigate to <a href="http://MyProductionURL/FakeLocation" rel="nofollow">http://MyProductionURL/FakeLocation</a>. How can I make the production location throw the HttpException so my code can handle it similar to how it works in my development environment?</p>
|
asp.net
|
[9]
|
1,333,499 | 1,333,500 |
How can i pass a list of objects (any object), through bundle, from activity A to Activity B?
|
<p>This is on the android platform, i have a list of objects of type (FitItem), and i want pass the list from my activity A to another activity B, and on the activity B i want get the list of objects again</p>
|
android
|
[4]
|
1,194,360 | 1,194,361 |
When would InitializeCulture be called
|
<p>I found many pages of my maintence website inherits a base page which overrides <strong>InitializeCulture</strong> to customize some globalization settings. </p>
<p>Is this method called <strong>everytime</strong> for any incoming request?</p>
<p>Thanks</p>
|
asp.net
|
[9]
|
5,155,990 | 5,155,991 |
Capture key press without placing an input element on the page?
|
<p>How to capture key press, e.g., Ctrl+Z, without placing an input element on the page in JavaScript? Seems that in IE, keypress and keyup events can only be bound to input elements (input boxes, textareas, etc)</p>
|
javascript
|
[3]
|
4,334,531 | 4,334,532 |
Disclosure button - TableRow
|
<p>I am creating a <strong>Table Layout</strong> in one of my activities. On touch of TableRow I am navigating to another activity. I want that each TableRow should have a disclosure button (like IPhone). It is not difficult adding a button in a TableRow. But I just want to know that is there a default property of TableRow of setting up <strong>Disclosure button</strong>?<br>
Also what do we generally follow? Creating a disclosure button in TableRow or not? </p>
<p>Thanks</p>
|
android
|
[4]
|
3,793,733 | 3,793,734 |
how do i make hazelcast to store in my database using MapStore implementation
|
<p>I implemented MapStore and configured hazelcast so that it would know that when calling map.put it has to call in background .store from my implementation, at least that`s what i read.</p>
<p>If i use my implementation directly it stores what i what but if i call map.put it doesn't.
Can someone tell me why it doesn't or if i`m doing something wrong?</p>
<p>here is my MapStore implementation:</p>
<pre><code>public class MyMapStore implements MapStore<String, Object> {
private Session session = HibernateUtil.openSession();
@Override
public Object load(String key) {
// TODO Auto-generated method stub
return null;
}
@Override
public Map<String, Object> loadAll(Collection<String> keys) {
// TODO Auto-generated method stub
return null;
}
@Override
public Set<String> loadAllKeys() {
// TODO Auto-generated method stub
return null;
}
@Override
public void store(String key, Object value) {
Transaction tx = session.beginTransaction();
session.save((MyObject)value);
tx.commit();
}
@Override
public void storeAll(Map<String, Object> map) {
// TODO Auto-generated method stub
}
@Override
public void delete(String key) {
// TODO Auto-generated method stub
}
@Override
public void deleteAll(Collection<String> keys) {
// TODO Auto-generated method stub
}
}
</code></pre>
<p>and here is how i configure hazelcast:</p>
<pre><code>h.getConfig().getMapConfig("default").setMapStoreConfig(
new MapStoreConfig().setEnabled(true).setClassName(
MyMapStore.class.getName()).setWriteDelaySeconds(0));
</code></pre>
<p>if i print the hazelcast configuration it tells that all i setted is there so i don't know what`s wrong.
P.S. i'm using hazalcast 2.2</p>
|
java
|
[1]
|
2,236,297 | 2,236,298 |
Javascript Document.bgColor does not work
|
<p>In the below code, I get the two dialog boxes, but the bgColor of the page is never changed. Is there any standard that font / color changes are not honored in JavaScript ?</p>
<pre><code> <html>
<head>
</head>
<body bgColor="GRAY">
<script type="text/javascript">
document.write("This message is written by JavaScript");
alert('Am here');
alert('Am here again');
document.bgcolor="WHITE";
</script>
</body>
</html>
</code></pre>
|
javascript
|
[3]
|
4,753,678 | 4,753,679 |
How to call Activity class method from another Activity classs
|
<p>My MainActivity class is:</p>
<pre><code>@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
UserInterface_Main UIMain = new UserInterface_Main();
setContentView(R.layout.activity_main);
UIMain.ExpendableListView();
}
</code></pre>
<p>The another Activity class is:</p>
<pre><code>public class UserInterface_Main extends Activity{
ExpandableListView exv;
public void ExpendableListView()
{
Context context = getApplicationContext();
exv=(ExpandableListView)findViewById(R.id.elv1);
exv.setAdapter(new MAdapter(context));
}
</code></pre>
<p>Now tell me how to call <code>ExpendableListView()</code> method from <code>MainActivity</code> class.</p>
|
android
|
[4]
|
1,638,295 | 1,638,296 |
HorizontalScrollView Inside an AlertDialog
|
<p>I am adding custom views to a custom ArrayAdapter. The xml layout I am using looks like this</p>
<pre><code> <LinearLayout>
<HorizontalScrollView>
<LinearLayout>
<TextView></TextView>
<TextView></TextView>
<TextView></TextView>
<TextView></TextView>
</LinearLayout>
</HorizontalScrollView>
<LinearLayout>
</code></pre>
<p>I then set the adapter for my AlertDialog.Builder as my custom ArrayAdapter and also supply the OnClickListener. My dialog shows fine and I am able to scroll the list vertically as well as scroll each view horizontally. However, when I click on any of the views it never fires the OnClickListener. I have tried setting the top most LinearLayouts descendantFocusability="blocksDescendants" but that has no effect. Is there anyway to do this within the AlertDialog? I have tried even creating a custom Dialog that implements OnGestureListener but none of the gesture events ever get called either. </p>
|
android
|
[4]
|
3,179,419 | 3,179,420 |
Python: copy basemap or remove data from figure
|
<p>I want to use a basemap figure as a background and plot things ontop. As the generation of the basemap figure (a polar stereographic plot) is quite time intensive I only want to do this once. </p>
<p>The second step would be to draw some wind barbs on this plot and some other wind barbs on the same plot, but without the first set of barbs.</p>
<p>Now either I copy the background image and then draw two different images or I can remove the first set of barbs and then draw the second, I don't mind which way to go.</p>
<p>Unfortunately my brain is not helping me today and I am getting nowhere. I would be grateful for any tips.</p>
|
python
|
[7]
|
5,697,666 | 5,697,667 |
how to send email using only through javascript or jquery?
|
<p>I am doing a project on platform java using jsp and servlets
I want to implement logic for a contact form for people who want to tell me feedback from the site
The feedback would go directly to the adminstrator's email. How would I do that?</p>
|
javascript
|
[3]
|
5,995,029 | 5,995,030 |
change background of an ImageView (the old image stays there!)
|
<p>how can I change the background of an ImageView from java? I have an ImageView and at a certain point I need to change the image that it displays (set in the styles). I tried to do it like this:</p>
<pre><code>placeHolder.setImageDrawable(myDrawb);
</code></pre>
<p>but it looks like the old image remains there and it is partially covered but the new one (which in my case has different shape).</p>
<p>hope you guys can help!</p>
<p>cheers</p>
|
android
|
[4]
|
800,169 | 800,170 |
need help in loading activity
|
<p>I have created following activity</p>
<pre><code> package com.ali.test;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class Test extends Activity implements OnClickListener {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
/*
OnClickListener onClickListener = new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent i = new Intent(this, Second.class);
startActivityForResult(i, ACTIVITY_CREATE);
}
};
*/
Button button = (Button) findViewById(R.id.button1);
button.setOnClickListener(this);
}
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
startActivity(new Intent(this, Second.class));
}
</code></pre>
<p>}</p>
<p>and want to load</p>
<pre><code> package com.ali.test;
import android.app.Activity;
import android.os.Bundle;
public class Second extends Activity{
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
</code></pre>
<p>but when i press the buttons app closes unexeptionaly</p>
|
android
|
[4]
|
4,315,082 | 4,315,083 |
javascript 'countdown' is not defined error
|
<p>I keep getting 'countdown is not defined' with this line</p>
<pre><code> var timeout = setTimeout('countdown()',1000);
</code></pre>
<p>It should loop the <code>function countdown()</code> every second. How do i solve this?</p>
<pre><code>function countdown() {
var until = $('.time-elapsed').attr('data-time');
var nextmonth = new Date(until);
var now = new Date();
var timeDiff = nextmonth.getTime() - now.getTime();
if(timeDiff <=0) {
var nextmonth = new Date(until);
}
var seconds = Math.floor(timeDiff / 1000);
var minutes = Math.floor(seconds / 60);
var hours = Math.floor(minutes / 60);
var days = Math.floor(hours / 24);
hours%=24;
minutes%=60;
seconds%=60;
$('.time-elapsed').find('ul:eq(0)').find('li:eq(1)').html(days);
$('.time-elapsed').find('ul:eq(1)').find('li:eq(1)').html(hours);
$('.time-elapsed').find('ul:eq(2)').find('li:eq(1)').html(minutes);
$('.time-elapsed').find('ul:eq(3)').find('li:eq(1)').html(seconds);
var timeout = setTimeout('countdown()',1000);
}
</code></pre>
|
javascript
|
[3]
|
699,683 | 699,684 |
Can I determine PHP array value deltas?
|
<p>I have two multidimensional arrays that I need to determine the delta for each value. I know the array_diff function only returns the difference in keys. Is there a functon that will determine the delta for each set of values assuming the two arrays contain the same set of keys?</p>
<p>Example:</p>
<pre><code>array_1(test1 => Array([key1] => 100, [key2] => 200 ) )
array_2(test1 => Array([key1] => 105, [key2] => 195 ) )
</code></pre>
<p>I would expect something like:</p>
<pre><code>array_3(test1 => Array([key1] => 5, [key2] => -5 ) )
</code></pre>
<p>Are there any PHP methods to do this or am I on my own?</p>
|
php
|
[2]
|
1,726,595 | 1,726,596 |
PHP to text function
|
<p>I am trying to create a function that would parse php code and return the result in pure text, as if it was being read in a browser. Like this one:</p>
<pre><code>public function PHPToText($data, $php_text) {
//TODO code
return $text;
}
</code></pre>
<p>I would call the function like this, with the params that you see below:</p>
<pre><code>$data = array('email' => 'test@so.com');
$string = "<?= " . '$data' . "['email']" . "?>";
$text = $this->PHPToText($data, $string);
</code></pre>
<p>Now <code>echo $text</code> should give: <em>test@so.com</em></p>
<p>Any ideas or a function that can achieve this nicely?</p>
<p>Thanks!</p>
|
php
|
[2]
|
4,479,720 | 4,479,721 |
jQuery: How can I wrap an element with a table (consisting of multiple rows)?
|
<p>The jQuery <a href="http://api.jquery.com/wrap/" rel="nofollow">.wrap()</a> function allows you to wrap any matched elements with some custom HTML. However, the function doesn't allow you to indicate where in the HTML you would like you matched element to be inserted -- <strong><em>it is always inserted into the inner most element</em></strong>.</p>
<p>I need to wrap a div with a fairly basic table (in order to add rounded corners to it), but the only catch is that the table has two rows and I want my element to appear in the second row. For example:</p>
<pre><code>$("#my-div").wrap('<table> \
<tr> \
<td class="corner-topleft" colspan="2"></td> \
<td class="corner-topright"></td> \
</tr> \
<tr> \
<td class="corner-bottomleft"></td> \
<td class="DIV-SHOULD-APPEAR-HERE"></td> \
<td class="corder-bottomright"></td> \
</tr> \
</table>');
</code></pre>
<p>If you try to execute this script, the wrap() function automatically places the matched element inside the <strong>first table cell</strong> (i.e. "corner-topleft") as this is the "first inner most element".</p>
<p><em><strong>How can I use jQuery to wrap my element with the multi-row table above?</em></strong></p>
|
jquery
|
[5]
|
1,612,505 | 1,612,506 |
How to call Search Dialog by click on a common button
|
<p>I created a Search Interface in Android. when we click on hardware search button our own search Dialog pops up. like this tutorial : <a href="http://www.edumobile.org/android/android-programming-tutorials/search-interface/" rel="nofollow">http://www.edumobile.org/android/android-programming-tutorials/search-interface/</a></p>
<p>Then I made a action bar
( <a href="http://developer.android.com/resources/samples/ActionBarCompat/index.html" rel="nofollow">http://developer.android.com/resources/samples/ActionBarCompat/index.html</a>)
and I put a search button on it. I want to load my search Dialog when I click on the button.(The same when I click on hardware search button on the phone)</p>
<p>I appreciate for any help.</p>
|
android
|
[4]
|
523,489 | 523,490 |
Best way to display the data from a 2 dimensional array on a ASP.net page
|
<p>I'm new to ASP.net,C#. </p>
<p>I'm trying to NOT use any database and hence running into issue.</p>
<p>I have a small application that will generate the questions and then stores them along with answers in a 2 dimensional array.
At the end, I want to display the contents in a tabular format on the same page.</p>
<p>When I tried to use GridView , it returns an error that the "data source is not a one dimensional array".</p>
<p>What is the best control that allows me to bind the 2D array as the datasource and then displays it on that page.</p>
|
asp.net
|
[9]
|
4,128,431 | 4,128,432 |
Casting from IEnumerable<Object> to IEnumerable<string>
|
<p>Recently I found a very surprising behavior in c#.
I had a method which takes <code>IEnumerable<Object></code> as a parameter and i was passing
<code>IEnumerable<string></code> but it's not possible.
While in c# everything can be upcast to Object than why this is not possible?
It's totally confusing for me.
Please someone clear me on this issue.</p>
|
c#
|
[0]
|
2,886,969 | 2,886,970 |
Undefined index: WPATH error
|
<p>I am trying to learn the PHP myself. When I try to execute or debug the code then I am getting the error as:</p>
<pre><code>Notice: C:\Program Files\OrangeHRM\2.6\htdocs\orangehrm-2.6\lib\exception\ExceptionHandler.php line 68 - Undefined index: WPATH
Notice: C:\Program Files\OrangeHRM\2.6\htdocs\orangehrm-2.6\lib\exception\ExceptionHandler.php line 88 - Undefined index: WPATH
Debug Strict (PHP 5): C:\Program Files\OrangeHRM\2.6\htdocs\orangehrm-2.6\lib\exception\ExceptionHandler.php line 103 - date() [<a href='function.date'>function.date</a>]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for '5.5/no DST' instead
PHP Warning: Module 'json' already loaded in Unknown on line 0
</code></pre>
<p>I have tried to keep the echo statement above the <code>Session['WPATH']</code>, I didn't get where they have set(assigned) and reset that.</p>
<p>please help me. Thanks in advance.</p>
|
php
|
[2]
|
1,471,184 | 1,471,185 |
listview rows customization
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/13099714/how-to-give-empty-space-between-rows-of-listview">How to give empty space between rows of listview?</a><br>
<a href="http://stackoverflow.com/questions/13099832/how-to-give-empty-space-between-pulltorefresh-listview-items-or-rows">How to give empty space between pulltorefresh -listview items or rows?</a> </p>
</blockquote>
<p>In my app I have a requirement of having a custom listView. I want to have empty gap between the rows, so that it looks like some blocks of rows.</p>
<p>I tried by keeping padding in my row XML, but didn't find solution.</p>
<p>I am using <code>pullToRefresh</code> ListView api to refresh the list. </p>
|
android
|
[4]
|
5,313,734 | 5,313,735 |
abstract class&interface
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/761194/interface-vs-abstract-class-general-oo">Interface vs Abstract Class (general OO)</a> </p>
</blockquote>
<p>can u tell what is the main difference between abstract class and interface in java.?</p>
|
java
|
[1]
|
56,217 | 56,218 |
How to convert Date.toString back to Date?
|
<p>I have a string obtained by calling the <code>toString</code> method of instance of the class Date.<br>
How can I get a Date object from this string?</p>
<pre><code>Date d = new Date();
String s = d.toString;
Date theSameDate = ...
</code></pre>
<p><strong>UPDATE</strong><br>
I've tried to use SimpleDateFormat, but I get <code>java.text.ParseException: Unparseable date</code>
Can you tell me the date format produced by Date.toString ()?</p>
|
java
|
[1]
|
3,352,169 | 3,352,170 |
removing strange characters from php string
|
<p>this is what i have right now</p>
<p>Drawing an RSS feed into the php, the raw xml from the rss feed reads:</p>
<pre><code>Paul&#8217;s Confidence
</code></pre>
<p>The php that i have so far is this.</p>
<pre><code>$newtitle = $item->title;
$newtitle = utf8_decode($newtitle);
</code></pre>
<p>The above returns;</p>
<pre><code>Paul?s Confidence
</code></pre>
<p>If i remove the utf_decode, i get this</p>
<pre><code>Paul’s Confidence
</code></pre>
<p>When i try a str_replace;</p>
<pre><code>$newtitle = str_replace("&#8221;", "", $newtitle);
</code></pre>
<p>It doesnt work, i get;</p>
<pre><code>Paul’s Confidence
</code></pre>
<p>Any thoughts?</p>
|
php
|
[2]
|
3,046,124 | 3,046,125 |
How to get an array of months in c#
|
<p>I want to get the month array in c#.<br>
somthing like this : <code>{ January , February , ... , December }</code><br>
How can I do this? please send me codes in C#.
thanks</p>
|
c#
|
[0]
|
4,633,574 | 4,633,575 |
onSingleTapUp of SimpleOnGestureListener Not working properly
|
<p>I have the below code:</p>
<pre><code>@Override
public boolean onSingleTapUp(MotionEvent event) {
int action = event.getAction();
if (action == MotionEvent.ACTION_UP) {
if (event.getRawX() > widthPixels / 2) {
// move to next screen
} else {
// move to previous screen
}
}
return true;
}
</code></pre>
<p>This code works fine but what happens is most of the times it moves to to screens forward or backward instead of moving to one screen.</p>
<p>Why is it so and what am I doing wrong here? </p>
|
android
|
[4]
|
5,854,243 | 5,854,244 |
Important About list View
|
<p>i have two form </p>
<p>first form have 3 textbox </p>
<p>1- for name
2- for age
3- for e-mail</p>
<p>second form have list view with three columns
1- for name
2- for age
3- for e-mail</p>
<p>i want when i complete the data of the three textbox in the first item and click on abutton
the data saved in the list view and when i enter data again the lisst view add the new data to it without removing the old data on it </p>
|
c#
|
[0]
|
2,070,155 | 2,070,156 |
cant access developer console to publish android apps!
|
<p>I have a problem. I can not access the developer console and all of my apps are off the market.</p>
<p>I never got anything from Google or the market.</p>
<p>Everything just disappeared...</p>
<p>Also when I try to publish an app in the developer console it takes me back to the sign up page...</p>
<p>What is going on?</p>
|
android
|
[4]
|
3,551,076 | 3,551,077 |
Is there anyway to handy convert a dictionary to String?
|
<p>I found the default implemtation of ToString in the dictionary is not what I want. I would like to have <code>{key=value, ***}</code>. </p>
<p>Any handy way to get it?</p>
|
c#
|
[0]
|
725,521 | 725,522 |
android multiple choice using images
|
<p>I have 10 images in an array which are answers to 10 questions which are also images in another array. </p>
<p>I have 10 image buttons coming up on my relative layout loaded with the 10 answer images. The answer array is answers[] and the questions array is questions[]. They correspond to each other, meaning that answers[1] is the answer to questions[1], and answers[4] is the answer to questions[4], and so on. I have a simple "for" statement which is <code>for(int i=0; i<=9; i++)</code>. </p>
<p>I want the 10 questions to come up one at a time, and let the user answer. I need the program to pause and let the user click the answer to the question. With that "for" statement, the first question which is questions[0] will pop up in imageview. Using if statements, I want to say "if the imagebutton with images[0] is clicked then I want an image to display that will say correct and do some other stuff, else I want an image to say incorrect and do some other stuff" and then I want it to pause until the user just clicks anywhere on the screen. </p>
<p>Can anyone help me with the pausing in the "for" statement to let the user answer, and the "if" statement where if the correct answer is picked I can display an image that says correct etc, and then pause again until the user just clicks anywhere on the screen?? Thanks!</p>
<p>By the way, I need those question images to pop up in the same imageview each time obviously, just changing the image.</p>
|
android
|
[4]
|
2,333,742 | 2,333,743 |
how to flip from one view to another view in iphone sdk
|
<p>I wan't to flip from one view controller to another for that i used following coding on button click</p>
<pre><code>-(void)ClicOnLogout {
LogOutViewController *logOut=[[LogOutViewController alloc]initwithnName:str];
logOut.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:logOut animated:YES];
}
</code></pre>
<p>but when i m in logout view controller there is one button but it won't work so can any one give me the proper solution for it.</p>
<p>Thanx...</p>
|
iphone
|
[8]
|
5,688,362 | 5,688,363 |
Validation summary control not showin message?
|
<p>I have a page with TextBox to enter a Mobile Number.
For that I have validated it using RequiredFieldValidator and RegularExpressionValidator
with display=none:</p>
<p>And also I have placed a ValidationSummary Control </p>
<pre><code><asp:ValidationSummary ValidationGroup="mobile" ShowSummary="false" ID="vsValid"
runat="server" ShowMessageBox="true" Enabled="true"
DisplayMode="SingleParagraph" />
<asp:TextBox ID="txtMobileNumber" runat="server" CssClass="Qinputbox"></asp:TextBox>
<asp:RequiredFieldValidator Display="None" ControlToValidate="txtMobileNumber"
ID="reqValidMobileNo" runat="server" ErrorMessage="*"
ValidationGroup="mobile"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ControlToValidate="txtMobileNumber" Display="None"
ID="regExValidMobileNo" runat="server"
ErrorMessage="Please enter a valid mobile number."
ValidationExpression="^((\+){0,1}91(\s){0,1}(\-){0,1}(\s){0,1}){0,1}9[0-9]
(\s){0,1}(\-){0,1}(\s){0,1}[1-9]{1}[0-9]{7}$"
ValidationGroup="mobile"></asp:RegularExpressionValidator>
</code></pre>
<p>when I entered characters in the TextBox it is not showing the summary.
What might be the problem?</p>
<p>Thanks in advance</p>
|
asp.net
|
[9]
|
5,175,935 | 5,175,936 |
Time delay in Javascript
|
<p>Function PS.Tick() is called every 100 milliseconds and its job is to call AI function of NPCs so they can move:</p>
<pre><code>PS.Tick = function ()
{
"use strict";
for (NPCid = 0; NPCid < NPCnumber; NPCid++)
{
NPCAI(NPCid);
};
};
</code></pre>
<p>But I want the NPCs to not move simultaneously every 100 millisecond, but do it at their own frequency, so I tried this code:</p>
<pre><code>PS.Tick = function ()
{
"use strict";
for (NPCid = 0; NPCid < NPCnumber; NPCid++)
{
var timeout = 0;
timeout = PS.Random (1000);
setTimeout("NPCAI(NPCid)",timeout);
};
};
</code></pre>
<p>Now, they don't move at all. Why? How do I make them move at different time intervals?</p>
|
javascript
|
[3]
|
1,327,041 | 1,327,042 |
iPad version crashing
|
<p>I am new to iOS development. I was opening the .xib file in the editor and tried to make an iPad version of the app. I went to File > Make iPad Version. An iPad UI appeared. I closed it and didn't save it.</p>
<p>The problem now is that the app is now crashing when viewed from an iPad.</p>
<p>Thanks!</p>
|
iphone
|
[8]
|
577,387 | 577,388 |
Where can I find the order of ListView events?
|
<p>I was wondering specifically about whether ItemCreated or ItemBound happens first but I can't seem to find any information on the order that ListView events fire. Can anyone point me to a resource for this information?</p>
<p>Note: this is for the System.Web.UI.WebControls.ListView</p>
|
asp.net
|
[9]
|
3,720,271 | 3,720,272 |
Not able to create thumbnails on linux environment in java application
|
<p>I am not able to create thumbnails on linux environment in java application.
Libraries which I am using this packages</p>
<pre><code>import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.MediaTracker;
import java.awt.Panel;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGEncodeParam;
import com.sun.image.codec.jpeg.JPEGImageEncoder;
</code></pre>
<p>to craete thumbnail</p>
<p>Graphics2D class to actually craete thumbnails.</p>
<p>This is working in windows environment and one of our linux machine also, but its not working in other linux machine whihch has no graphics crad in it.</p>
<p>Please advice and help.</p>
<p>Thanks in advance</p>
|
java
|
[1]
|
1,478,670 | 1,478,671 |
I would like to make a function which is using picture and phone number in MMS
|
<p>I would like to display the picture and phone number contained in an MMS, in my application. What API call(s) would I use to get this information?</p>
|
android
|
[4]
|
4,172,702 | 4,172,703 |
Baking an external .exe into a C# project
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/573105/embedded-a-exe-into-a-dll">Embedded a *.exe into a dll</a> </p>
</blockquote>
<p>I have a C# project - a class library - that produces a DLL file.</p>
<p>From within itself, this project runs an external .exe file. (Using the standard Process stuff, and it works fine.)</p>
<p>However, my question is: How can I bake the external .exe file into the project, such that the end-consumer will only receive the final DLL file, without ever seeing the .exe file itself?</p>
<p>This will make my client happier, as he will continue receiving one DLL file (as before, before I needed the .exe).</p>
|
c#
|
[0]
|
238,031 | 238,032 |
Android - getting from a Uri to an InputStream to a byte array?
|
<p>I'm trying to get from an Android Uri to a byte array. </p>
<p>I have the following code, but it keeps telling me that the byte array is 61 bytes long, even though the file is quite large - so I think it may be turning the Uri <strong>string</strong> into a byte array, rather than the file :(</p>
<pre><code> Log.d(LOG_TAG, "fileUriString = " + fileUriString);
Uri tempuri = Uri.parse(fileUriString);
InputStream is = cR.openInputStream(tempuri);
String str=is.toString();
byte[] b3=str.getBytes();
Log.d(LOG_TAG, "len of data is " + imageByteArray.length
+ " bytes");
</code></pre>
<p>Please can someone help me work out what to do?</p>
<p>The output is "fileUriString = content://media/external/video/media/53" and "len of data is 61 bytes".</p>
<p>Thanks!</p>
|
android
|
[4]
|
3,212,019 | 3,212,020 |
Whare are general knowledge you should learn before (Java Developer) inteview?
|
<p>You are applying for a role "Java Developer" and you are called for an interview.
What are the general knowledge you should/must learn before you sit in front of the panel?</p>
|
java
|
[1]
|
220,366 | 220,367 |
Printing html file on server without browser
|
<p>I have a html template file, i am using server side java code to fill in the template and now want to print the file on the same server. Now when i print it, html tags are also coming. What should i do to get html formatting also rather than tags?</p>
|
java
|
[1]
|
2,370,929 | 2,370,930 |
Generate multiple DropDownLists
|
<p>I have to generate multiple dropdownlists on clientclick.
That is new dropdownlists on every client click.
I placed a button and wrote code on click event.</p>
<p>protected void addReq1_Click(object sender, ImageClickEventArgs e)</p>
<pre><code>{
DropDownList oDdl = new DropDownList();
oDdl.ID = "ddlReq" + (++i).ToString();
oDdl.DataSourceID = "DSUsers";
oDdl.DataTextField = "UName";
oDdl.DataValueField = "UName";
HtmlTableCell tc0 = new HtmlTableCell();
HtmlTableCell tc1 = new HtmlTableCell();
HtmlTableCell tc2 = new HtmlTableCell();
HtmlTableCell tc3 = new HtmlTableCell();
tc2.Controls.Add(oDdl);
HtmlTableRow tr = new HtmlTableRow();
tr.Cells.Add(tc0);
tr.Cells.Add(tc1);
tr.Cells.Add(tc2);
tr.Cells.Add(tc3);
search2.Rows.Add(tr);
}
</code></pre>
<p>Here "DSUsers" is SqlDataSource.</p>
<p>"i" is static variable.</p>
<p>"serarch2" is html table with runat server tag</p>
<p>The problem is only one control is getting rendred,
after that on every additional click same DropDownList is getting replaced.
No new DropDownList is added to the page.</p>
<p>Thank You.</p>
|
asp.net
|
[9]
|
5,859,820 | 5,859,821 |
Download Big media files in android
|
<p>im trying to download media files through my application for which i wrote a method which read bytes from the source file and return bytes array,</p>
<p>byte[] mediainfo = getMediaFile(String path);</p>
<p>but the problem is that when the file size will become greater than 5 or 6MB it will return outofMemory exception,please kindly give some idea how i will download big media file about 10 mb through my application,
thanks.</p>
|
android
|
[4]
|
4,586,337 | 4,586,338 |
Setting a hard limit for image size using PHP
|
<p>I have this script for displaying a slideshow for a client.</p>
<p>I'm looking for a quick way of making the "<strong>img</strong>" not go over a certain size.</p>
<p><strong>This is my original code:</strong> </p>
<pre><code><script type="text/javascript">
$(function() {
$('#test2').crossSlide({
speed: 15,
fade: 1
}, [
<?php
$directory = "photos/";
$images = glob("" . $directory . "*.jpg");
$arrLength = count($images);
foreach($images as $key=>$image){
echo("{src: '$image', dir: '$quotes[$random]'}");
if($key < $arrLength - 1){ echo ", "; }
}
?>
]);
});
</script>
</code></pre>
<p>Prehaps I could use some sort of external file?</p>
<p>Link it like.. image.php?img=foo.jpg (with the max script in there?)</p>
<p>Any help would be great,</p>
<p>Thanks!</p>
|
php
|
[2]
|
5,340,237 | 5,340,238 |
How to find out the path& filename to the application launcher icon declared in Android manifest
|
<p>I figured out that I can reuse my app's launcher icon inside my app, which is declared in the manifest as a launcher icon. I am doing this by simply calling the icon image from a layout xml file with the same file name and path as declared in the Android manifest.</p>
<pre><code>e.g.:
<ImageView
...
android:src="@drawable/ic_launcher">
</ImageView>
</code></pre>
<p><strong>The problem is:</strong> that if in the future I changed the icon's name/path in the manifest file, the code in the layout file would also need to be updated. Also, I would like to be able to reuse this piece of layout code in my next app without worrying about what filename & path has been declared in the manifest for the icon.</p>
<p><strong>Can I find out from my code the name&path declared in the manifest file for the launcher icon?</strong> This would allow me to read the manifest first then use the same name&path from the layout file.</p>
|
android
|
[4]
|
1,952,735 | 1,952,736 |
jQuery find by inline css attribute
|
<p>I need to find an element based on a specific css attribute. the css is applied inline and I can not use a class.
Is there anyway to achieve this in jquery?</p>
|
jquery
|
[5]
|
2,325,173 | 2,325,174 |
My firefox can't run java
|
<p>I check this at: <a href="http://javatester.org/version.html" rel="nofollow">http://javatester.org/version.html</a></p>
<p>I already downloaded the latest SDK. It seems the issue is that </p>
<p>Java (TM) Platform SE 7 U5 10.5.1.255 has a warning that it has vulnerability and use with caution.</p>
<p>The thing is it's NOT disabled.</p>
<p>Also I already updated JDK to the latest version. I want to uninstall the plugin but there is no such option. I can only disable.</p>
<p>My other computer's firefox are doing fine.</p>
|
java
|
[1]
|
2,496,672 | 2,496,673 |
Launch app on incoming call (android)
|
<p>I have an app on Android that reacts to incoming calls.
Now, since the OS shuts my app down whenever it want,
I need a way to to listen to the incoming calls and launch the app when it happens.</p>
<p>Will a BroadcastReceiver help? (just like launching on device restart)</p>
<p>Any idea?</p>
<p>thanks!</p>
|
android
|
[4]
|
6,032,941 | 6,032,942 |
Trying to make my Java method generic so that it can compare Strings or Dates
|
<p>Below is the method I have. It works fine for comparing Strings. I would like to make it capable of also comparing Dates or possibly any class that has an acceptably defined compareTo method. Looking for an easy way to do this. I was heading down a hacky path. Also open to any other suggestions to improve this method.</p>
<pre><code>protected <E> int compareFields(E o1, E o2,String fieldName){
String o1Data;
String o2Data;
try {
o1Data = (String) o1.getClass().getMethod(fieldName).invoke(o1);
o2Data = (String) o2.getClass().getMethod(fieldName).invoke(o2);
}
catch(Exception e) {
throw new RuntimeException(e);
}
if(o1Data == null && o2Data == null){
return 0;
} else if (o1Data == null){
return 1;
} else if (o2Data == null){
return -1;
}
return o2Data.compareTo(o1Data);
}
</code></pre>
|
java
|
[1]
|
3,263,273 | 3,263,274 |
Timestamp to: Days - Hours - Minutes
|
<p>Can someone please tell me how can I convert a specific timestamp to days - hours - minutes in PHP?</p>
<p>For example I'd like to get something like this: (20 days 13 hours 35 minutes) from a random timestamp like this: 534222234</p>
<p>Thank you.</p>
|
php
|
[2]
|
5,348,080 | 5,348,081 |
Replacing ? from document.location.search
|
<p>I have the following code which i am using document.location.search in it.. I want to replace the ? with an &.. How i can do that please?</p>
<pre><code><script language="javascript">
document.write("<a href='http://www.gfi.com/downloads/downloads.aspx?pid=fax&lid=en" + document.location.search + "'><img src='http://images.gfi.com/download-imagery/button-download.png' border='0'></a>");
</script>
</code></pre>
|
javascript
|
[3]
|
3,314,206 | 3,314,207 |
What does a !! in JavaScript mean?
|
<blockquote>
<p><strong>Possible Duplicates:</strong><br>
<a href="http://stackoverflow.com/questions/3772552/myvar-someothervar">myVar = !!someOtherVar</a><br>
<a href="http://stackoverflow.com/questions/1406604/what-does-the-operator-double-exclamation-point-mean-in-javascript">What does the !! operator (double exclamation point) mean in JavaScript?</a> </p>
</blockquote>
<p>Came across this line of code</p>
<pre><code>strict = !!argStrict
</code></pre>
<p>... <a href="http://github.com/kvz/phpjs/raw/master/functions/array/in_array.js" rel="nofollow">here</a> and wondered what effect the <code>!!</code> has on the line? Pretty new to JS!</p>
|
javascript
|
[3]
|
4,089,003 | 4,089,004 |
How to view two Layouts in one Activity?
|
<p>Is there any way to make this possible? I'm using Inflate but its not working. So did anyone have any other way?</p>
|
android
|
[4]
|
1,313,230 | 1,313,231 |
Read from Dataset
|
<p>I need to read value of the dataset.
This dataset return many rows. and each rows have single value (Customer_Name)</p>
|
c#
|
[0]
|
2,481,369 | 2,481,370 |
jQuery load a page on click then automatically load a div
|
<p>I am wanting to redirect a page on click, and then load specified content into on of those pages div.</p>
<p>How do I go about doing this?</p>
<p>For example:</p>
<pre><code><div id="redirect">Click here to go to new page</div>
</code></pre>
<p>When the new page loads, there will be a div with <code>id = content</code> that needs to have content automatically loaded via ajax based on data sent from the redirect id on the previous page.</p>
|
jquery
|
[5]
|
5,702,975 | 5,702,976 |
PHP Perl combination
|
<p>I have developed an interface that takes data from the users. I need to take this data to a perl script that I have already written. Now the problem is that I am not able to figure out how to call the Perl script automatically from the PHP interface.
I don't have enough experience with PHP, so have no clue how to internally call the Perl script. </p>
|
php
|
[2]
|
991,974 | 991,975 |
Converting String to Int in Java using Arrays
|
<p>I'm trying to convert the string values to integers, however whenever i do this, it gives me the ASCI value of the character instead of the actual typed string. </p>
<p>Example: </p>
<p>a user inputs "11101" on there keyboard to a string variable named binary</p>
<pre><code>for(int i = 0; i < binary.length(); i++){
storage[i] = Integer.valueOf(binary.charAt(i));
}
</code></pre>
<p>if I look at the values of storage[i], i will see only the ASCI values of the numbers, and not the actual 1's or 0's</p>
|
java
|
[1]
|
2,177,825 | 2,177,826 |
C# : How to add an email attachment from a byte array?
|
<p>I have a byte[] which is a file, and I would like to send it as an attachment using System.Net.Mail. </p>
<p>I noticed the attachment class has 1 overload which accepts a stream. </p>
<pre><code>Attachment att = new Attachment(Stream contentStream,string name);
</code></pre>
<p>Is it possible to pass the byte[] through this overload?</p>
|
c#
|
[0]
|
1,082,925 | 1,082,926 |
How to individually animate random lines of color in jQuery?
|
<p>So far, I have a simple script that checks the size of the document and creates a 1px div for each line in the doc and applies a random color to each line. I want to animate each lines background color individually, so all the lines pulsate and change colors.</p>
<p>Here is my code:</p>
<pre><code><script type="text/javascript">
$(document).ready(function() {
var pageHeight = $(window).height();
for(var i = 0; i < pageHeight; i++) {
$('body').prepend('<div class="myDiv '+i+'"></div>');
};
$('.myDiv').each(function() {
var myColor = randomColor();
//alert (myColor);
$(this).css("background-color", "rgb(" + myColor + ")");
});
});
function randomColor () {
var color1 = randomFromTo(100,255);
var color2 = randomFromTo(200,255);
var color3 = randomFromTo(0,100);
return color1 + "," + color2 + "," + color3;
};
function randomFromTo(from, to){
return Math.floor(Math.random() * (to - from + 1) + from);
}
</script>
<style>
body { margin:0; }
.myDiv { height:1px; }
</style>
</code></pre>
|
jquery
|
[5]
|
4,652,771 | 4,652,772 |
Bitshifting to read/write data
|
<p>I am sending 2 integers as one long in Java, and cannot work out for the life of me how to send these across properly using bit shifting.</p>
<p>I have a method to create the long:</p>
<pre><code>public long create(int one, int two){
return (one <<32 & two);
}
</code></pre>
<p>First of all, is this correct? (To send the two integers in one long together)</p>
<p>Secondly, if I want to then access either one or two, how do I go about that?</p>
<p>Is it a simple case of:</p>
<pre><code> public static int getOne(long theLong) {
return (int)theLong >> 32;
}
</code></pre>
<p>Or is there something a little more complicated?</p>
<p>Some guidance is much appreciated, thanks!</p>
|
java
|
[1]
|
4,915,853 | 4,915,854 |
How to return a pointer that uses a custom constructor
|
<p>I'm getting this error:</p>
<p><code>Expected '(' for function-style cast or type construction</code></p>
<p>On the second line:</p>
<pre><code>struct OpenALInterface * CreateOpenALInterface(int numLoadedSounds, int numPlayingSounds){
return new IOS_OpenAL(int numLoadedSounds, int numPlayingSounds); //ERROR ABOVE
// return new IOS_OpenAL(); //this works fine, no error
};
</code></pre>
<p>Class has this:</p>
<pre><code>class IOS_OpenAL: public OpenALInterface{
public:
IOS_OpenAL(int numLoadedSounds, int numPlayingSounds){
//do stuff
};
// IOS_OpenAL(){}; //works
</code></pre>
<p>What exactly is this error referring to? It looks like a syntax error.</p>
<p>The base class is abstract with no constructors. Is that the issue? Can a subclass override or have its own constructor not in the base class?</p>
|
c++
|
[6]
|
2,459,919 | 2,459,920 |
javascript multiple input textbox validation
|
<p>I have 'n' number of textbox on a form, after the user enters a value in a textbox, i need to validate its not a duplicate in the other textboxes.</p>
<p>Ex : </p>
<pre><code>Textbox[0] : 1
Textbox[1] : 2
Textbox[2] : 3
Textbox[4] : 1
</code></pre>
<p>For this example it should alert saying that '1' have entered twice.
Let me know what to be done.</p>
|
javascript
|
[3]
|
3,201,198 | 3,201,199 |
PHP loop with specific $_REQUEST
|
<p>Is it possible to loop based on a specific variable name for a <code>$_REQUEST</code> for example:</p>
<pre><code>if (!$POST)
{
do something
}
else {
if ($_REQUEST['name1'])
{
do something
}
elseif ($_REQUEST['name2'])
{
do something
}
}
</code></pre>
|
php
|
[2]
|
1,637,116 | 1,637,117 |
Select an image from JPanel
|
<p>I am working on a small project which requires me to load images into a window and then move them around at will.</p>
<p>Thus far I can load images onto a JPanel simply by using a graphics object to draw them to the JPanel.</p>
<p>Now I'm faced with the challenge of figuring out how to differentiate between the various images I've loaded when I click on them so I can drag them around the screen.</p>
<p>Any ideas?</p>
|
java
|
[1]
|
529,551 | 529,552 |
Include file in PHP form show error and content of included file
|
<p>I have included php class file which contains all the classes as
But in output it is showing content of classes.php file and fatal error class not found here i only want to use the classes written in "classes/classes.php".But it is showing contents of this file in output.
please help me,i have tried all the ways.
Thank U in advance.</p>
|
php
|
[2]
|
1,783,488 | 1,783,489 |
How to print a list in Python "nicely"
|
<p>In PHP, I can do this:</p>
<pre><code>echo '<pre>'
print_r($array);
echo '</pre>'
</code></pre>
<p>In Python, I currently just do this:</p>
<pre><code>print the_list
</code></pre>
<p>However, this will cause a big jumbo of data. Is there any way to print it nicely into a readable tree? (with indents)?</p>
|
python
|
[7]
|
5,454,199 | 5,454,200 |
Pass value from page to a Jquery POpUp?
|
<p>I have a Jquery POpup which calls a page internally .Page has a bound repeater on that.I need to acess the Page's repeater from the popup.How to acheive this?</p>
<p>Thanks</p>
|
jquery
|
[5]
|
962,445 | 962,446 |
How to import a variable from different file types
|
<p>I am trying to obtain a variable from a different file type and import it into a Python script. The file is version.mk, it has a variable called VARIABLE_ID. The import module does not work as normally, is there any way to call variables from other file types?</p>
<p>Thanks for any help</p>
<pre><code>import os
from version import VERSION_ID
def versionid:
print VERSION_ID
</code></pre>
<p>This is the code that does not work.</p>
<p>The version ID is 0.0.2 format. When I run the below code it says there is a syntax error in the number.</p>
<p>I have read that distutils has a version numbering convention. I am not sure how this could be used, has anyone heard or know how this works?</p>
<p>Is there a way of having cooments in this file, when comments are in the file it interferes with the file. Could the read() just read the version_id and not the comments, thanks</p>
<pre><code>VERSION_ID=map(int,re.match("VERSION_ID\s*=\s*(\S+)",open("version.mk").read()).group(1).split("."))
</code></pre>
|
python
|
[7]
|
5,428,888 | 5,428,889 |
PHP Expression Woes
|
<p>I'm trying to do regular expression in PHP but I keep getting bugged. I want it so it's A-Z, 0-9, and the underscore (_) but the underscore cannot be used on the edges of a text. Only on the inside.</p>
<p>Here is waht I have:</p>
<pre><code>if (!ereg("^[a-zA-Z0-9_]{3,16}$",$username)) {
// Does not match
}else{
// Good job, within rules!
}
</code></pre>
|
php
|
[2]
|
3,446,011 | 3,446,012 |
Existing library for quick menu like in Google+ app?
|
<p>A design pattern I've noticed being used recently in some Android apps is a simple textual list menu similar to QuickActions in that it pops up in a speech-bubble-like View when summoned. The Google+ app uses it for overflow items, for example.</p>
<p><img src="http://i.stack.imgur.com/E6b8C.png" alt="enter image description here"></p>
<p>Does anybody know of a library that'll let me easily implement these kinds of menus in my own app or, if not, what the most straightforward way of doing it from scratch would be?</p>
<p>Many thanks.</p>
|
android
|
[4]
|
3,908,774 | 3,908,775 |
Switch-case with variations in android
|
<p>I wonder if I can turn the following chart into switch-case statement in android. I know I can do it with if-else but I just wonder if I can...
E.g- </p>
<pre><code>switch (bodyfat)
case 2-4 : show (Essential Fat);
case 6-13 : show (Athelete Fat);
</code></pre>
<p>.......
<img src="http://i.stack.imgur.com/otfUx.jpg" alt="enter image description here"></p>
|
android
|
[4]
|
401,929 | 401,930 |
How do I run javascript to revert what some code in an embedded script resource just did?
|
<p>So, I'm working on a mapping application. In the app there are these toolbars and based on certain circumstances I would like to disable specific tools. When a tool is disabled it's image changes. This part works fine.</p>
<p>Now, there is all this Javascript that is in embedded script resources that is ran when certain actions occur, like selecting a tool. I have no power over this Javascript.</p>
<p>What happens is some Javascript gets ran that essentially changes the image back from it's disabled one to it's default one. This is bad.</p>
<p>I'd like to know if there is any way to tell if the code from the script resource has ran or any way to see when the image has been changed so I can immediately change it back. Essentially over-riding the code in the script resource. </p>
<p>To word it differently, whenever this icons image changes from the disabled one to the enabled one via this specific javascript code, can I immediately change it back to the disabled image?</p>
|
javascript
|
[3]
|
2,989,542 | 2,989,543 |
jQuery opacity on hover
|
<p>Please, help to rewrite this jQuery function:</p>
<pre><code>$(".gallery dt a img").fadeTo("fast", .7);
$(".gallery dt a").hover(function () {
$(this).fadeTo("fast", 1)
},
function () {
$(this).fadeTo("fast", .7)
});
</code></pre>
<p>Here is a html:</p>
<pre><code><dl class="gallery">
<dt><a href="#"><img /></a></dt>
<dd><a href="#">text</a></dd>
</dl>
</code></pre>
<p>Image appears (opacity: 1) when I hover a link in <code><dt></code> tag, how can I change this, to make image appear when I hover a links in both <code><dt></code> and <code><dd></code> tags?</p>
<p><strong>Nobody knows?</strong></p>
|
jquery
|
[5]
|
3,350,279 | 3,350,280 |
What is the best way to handle processing in PHP from either logins or form posts
|
<p>I am pretty new to PHP and have yet to find really practical book which describes how to best process things in PHP in a real world situation, with security in mind. Even searching google, most articles are just about the basics, and are not real world examples. I just don't see anything good out there on PHP structure and flow for a website as a whole.</p>
<p>What I have adopted is for example, if a user fills out a login form in ABC.php, the data is posted to XYZ.php?do=processLogin . In XYZ, I have an "IF ISSET" for the "do" variable and if it's set then it enters a switch statement which handles logins, or logoffs, etc, and then redirects them back to the appropriate page. If the "do" variable is not set, they get dumped back to the login page.</p>
<p>I've seen many examples where data is posted to the same script, however just about anytime I am doing any sort of form processing or an action such as a login of logoff or account editing, I am posting to completely seperate PHP file to take care of that work, and then redirecting the user back. </p>
<p>Is this way sub-optimal, abnormal, stupid?? Can someone give me some advice on this, or link some good examples related to this topic? I was thinking lately of finding some open source app written in PHP so that I can view how an experienced PHP coder structures their site, so if anyone has an example of one of those to look at, that would be appreciated too.</p>
<p>Thanks in advance!</p>
|
php
|
[2]
|
5,561,782 | 5,561,783 |
jquery: get attribute name value of <input>
|
<p>How to get the attribute name value of a input tag using jquery. Please help.</p>
<pre><code><input name='xxxxx' value=1>
</code></pre>
|
jquery
|
[5]
|
242,070 | 242,071 |
PHP Mail/Postfix always returns true even when Postfix is stopped
|
<p>I have a weird problem. Using the mail() function and a local Postfix on the server. When Postfix is running, mail gets sent just fine but if I stop Postfix mail() still returns true but no e-mails are obviously sent and no error gets logged anywhere.</p>
<p>Code for sending:</p>
<pre><code>echo $accepted; //Returns 0
$accepted = mail($to, $subject, $message, $headers);
echo $accepted; //Returns 1
</code></pre>
<p>No other MTAs are running at the server.</p>
<p>Is there any good way of debugging this?</p>
|
php
|
[2]
|
925,808 | 925,809 |
how to place buttons inside a layout at desired positions in android
|
<p>I am new to android, In my project named Fill In the Blanks I have to place textviews and editboxes at desired positions in a layout . plz help me
Thank you in advance.</p>
|
android
|
[4]
|
1,244,111 | 1,244,112 |
Change APN settings by code in Android
|
<p>I want to change the APN settings by code in Android. I need it to be done from browser.</p>
<p>Is it possible to change the APN settings from browser?</p>
|
android
|
[4]
|
441,188 | 441,189 |
How to make a modal confirmation dialog before submitting a form?
|
<p>I am a beginner in web/javascript programming and wonder if anyone can give me a kick start simple example of a modal confirm dialog just before a form with multiple submit buttons being submitted using a pre-defined button? I stumbled upon jQuery and SimpleModal and wonder if it would fit my ASP MVC project.</p>
<p>I ended up in the following non-working codes, I think my 1st problem is do not know how to return a value from the dialog?:</p>
<pre><code><script type="text/javascript">
$(document).ready(function() {
$("form").submit(function(ev) {
return confirm("Confirm?");
});
});
function confirm(message) {
$("#confirm").modal({
close: true,
overlayId: "confirmModalOverlay",
containerId: "confirmModalContainer",
onShow: function modalShow(dialog) {
dialog.overlay.fadeIn("slow", function() {
dialog.container.fadeIn("fast", function() {
dialog.data.hide().slideDown("slow");
});
});
dialog.data.find(".confirmMessage").append(message);
dialog.data.find(".btnYes").click(function() {
$.modal.close();
});
}
})
}
</script>
<div id="confirm" style="display:none">
<a href="#" title="Close" class="modalCloseX simplemodal-close">x</a>
<div class="confirmHeader"><span>Confirm</span></div>
<p class="confirmMessage"></p>
<div class="buttons">
<div class="btnYes">Yes</div><div class="btnNo simplemodal-close">No</div>
</div>
</div>
</code></pre>
<p>It would be nice if anyone direct me to somewhere online for a crash course of web programming :)</p>
|
jquery
|
[5]
|
5,578,965 | 5,578,966 |
How can I convert an HTML page to an image or PDF and then convert it to byte array?
|
<p>How can I convert an HTML page to an image or PDF and then convert it to byte array?</p>
|
java
|
[1]
|
2,341,076 | 2,341,077 |
What is a postback?
|
<p>The best explanation I've found for a postBack is from <a href="http://en.wikipedia.org/wiki/Postback">Wiki.</a></p>
<p><em>a postback is an HTTP POST to the same page that the form is on.</em></p>
<p>While the article does explain how a second page was needed in ASP, but no longer needed in ASP.NET, it doesn't give much detail or background. I am looking for a freakin' tome of information on PostBacks. Much like the simple question of "how can I clean a house" can be address by this <a href="http://rads.stackoverflow.com/amzn/click/068481465X">900 page book</a>. I don't need 900 pages worth, but details please. I found a nice little tutorial for ASP.NET life cycle, but it seriously glosses over postbacks (amongst other things). </p>
<p>I am looking to the developer's who have been around before .NET and really don't take these kinds of things for granted. Books and hyperlinks are reasonable answers or addition's to your answer.</p>
|
asp.net
|
[9]
|
1,223,351 | 1,223,352 |
How can I find hard disk speed
|
<p>How can I find hard disk speed ?
I can not use System.IO.File.Copy and use timer to get hard disk speed , because after caching file , the speed will be really higher than real time .</p>
<p>what can I do ?</p>
|
c#
|
[0]
|
5,214,868 | 5,214,869 |
Higher API calls while lower SDK targeting
|
<p>My app supports minSdkVersion=10 and targeting 16. I want to call methods specific to API level >= 14 if a specific device supports them. I could check running OS version at runtime and whether call or not higher API methods but when I specify min SDK version, methods that exist only in versions higher than 10 are not visible.
Is there any way to use higher API methods than minSdkVersion?</p>
|
android
|
[4]
|
5,198,901 | 5,198,902 |
how to pass last click item to another page using jquery
|
<p>how do i pass the last clicked item to another page using jquery? I have this toggle menu in my web app. what i want to happen is when i clicked a link in my toggle menu it will go to the another page but it will retain the selected toggle menu open. Is this possible?</p>
<p>here's my toggle menu code for jquery </p>
<pre><code><script>
$(document).ready(function(){
$(".product-contents").hide();
$("div.product-header").click(function(){
$(this).toggleClass("active").next().slideToggle("fast");
});
});
</script>
</code></pre>
|
jquery
|
[5]
|
1,810,273 | 1,810,274 |
Android Porting Testing - Ported on meego, Ubuntu, Tizen, Windows, WebOS More
|
<p>I need your help and sharing of knowledge. I want to test Following Android OS features after porting on MEEGO / Ubuntu / HP webOS on Notebook / tablet / touchscreen mobile.</p>
<pre><code>Audio ;
Bluetooth;
Camera;
Display;
GPS;
Input;
Lights;
Media;
Network interfaces;
Power Management;
Radio (Phone);
Storage;
Sensors;
Wifi;
Vibrator;
2D and 3D graphics;
USB;
Memory and Storage;
SIM Toolkit Application (STK);
language ;
Take setting from base OS;
Accelerometers;
Notification Manager;
Memory Leaks;
</code></pre>
<p>Can you help me to get scenarios and list of application with which we can test Ported OS on MEEGO / Ubuntu / HP webOS on Notebook / tablet / touchscreen mobile ?</p>
|
android
|
[4]
|
3,205,525 | 3,205,526 |
Trouble making android apps work for tablets
|
<p>I've got someone who wants to download an app to their Xoom, but when they go to download it, it says that the app is limitted to phones only. The android market settings say that the app is supported by the Xoom though, so I'm at a bit of a loss. Could this be a coding issue? The app was originally designed for API level 8, but I'd think it should be forward compatible... Xlarge screens are supported, as are all densities, but the Xoom still says that it can't download the app...</p>
<p>Anyone know what's going on here?
Thanks!</p>
<p>Here's the manifest up to activities:</p>
<pre><code><xml version="1.0" encoding="utf-8" ?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.bjpcomet.XCScore" android:versionCode="1" android:versionName="1.0">
<uses-sdk
android:minSdkVersion="1"
android:targetSdkVersion="8"/>
<application
android:icon="@drawable/icon"
android:label="@string/app_name"
android:debuggable="false">
<activity
android:name="com.bjpcomet.XCScore.ScoringApp"
android:label="@string/main_title">
</code></pre>
|
android
|
[4]
|
5,511,399 | 5,511,400 |
Need to reference a local variable before assigning
|
<p>I'm currently working on a permutation algorithm that will be used for a traveling sales person kind of problem. I have a method to calculate the cost of the cycle that will call a method (currentBest) to see if this permutation is better than currentBest one.</p>
<pre><code> def currentBest(newCost):
if newCost < currentBest:
currentBest = newCost
return currentBest
</code></pre>
<p>But the first time i run though this code currentBest will not have a value so i guess i have to assign it a value first but it has to remember the currentBest value for the other permutation so making a currentBest = 999 at the top of the code I don't think will work.</p>
<p>Thank you</p>
|
python
|
[7]
|
596,635 | 596,636 |
How do i change everything behind a certain point in a Jagged array?
|
<p>Say I have a jagged array, and position 2,3 is taken by int 3. Every other spot is filled with int 0. How would I fill all the positions behind 2,3 with a 4?</p>
<pre><code>0 0 0 0 0 0
0 0 0 0
0 0 0 3 0 0
0 0 0 0 0
</code></pre>
<p>to this:</p>
<pre><code>4 4 4 4 4 4
4 4 4 4
4 4 4 3 0 0
0 0 0 0 0
</code></pre>
<p>Ive tried variations of this:</p>
<pre><code>int a = 2;
int b = 3;
for (int x = 0; x < a; x++)
{
for (int y = 0; y < board.space[b].Length; y++)
{
board.space[x][y] = 4;
}
}
</code></pre>
|
c#
|
[0]
|
5,054,108 | 5,054,109 |
Correct Ternary Condition for IF ElseIf Condition
|
<p>Here is my If Else Statement</p>
<pre><code>if(isset($row['content']) && strlen($row['content'])) {
$content = $row['content'];
}
elseif(isset($row['description']) && strlen($row['description'])) {
$content = $row['description'];
}
</code></pre>
<p>I tried to create a condition using ternerary operator and ended for with a error: Here is my ternerary condition</p>
<pre><code>$content = isset($row['content']) && strlen($row['content']) ? $row['content'] : isset($row['description']) && strlen($row['description']) ? $row['description'] : '';
</code></pre>
<p>What is the correct statement?</p>
|
php
|
[2]
|
2,111,102 | 2,111,103 |
Format string with no decimals OR 2 decimals
|
<p>I have a float number. I want to convert it to a string with the following two rules</p>
<ul>
<li>If the float has no decimal part then do not create any decimal part</li>
<li>If the float has a decimal part then convert it to two decimal places</li>
</ul>
<p>For example</p>
<pre><code>499 => "499"
499.5 => "499.50"
499.99 => "499.99"
499.989 => "499.99"
</code></pre>
<p>How would you do that in php?</p>
|
php
|
[2]
|
5,321,038 | 5,321,039 |
jquery fadeout text and image opacity changes
|
<p>I have something like this</p>
<pre><code><div id="dis_image"></div>
<div id="images">
<img src="1/1.jpg" class="image" style="opacity:0.3" />
<img src="1/2.jpg" class="image" style="opacity:0.3" />
</div>
<ul style="display:none" id="images_list">
<li>testing 1</li>
<li>testing 2</li>
</ul>
</code></pre>
<p>What i am planning to do is every 5 seconds, i want the first text from <code>id:images_list</code> to display on <code>id:dis_images</code> and <code>id:images</code> first image changes opacity from 0.3 to 1
then, proceed to second one, first text and first image is replaced by second text and second image and so with opacity. The first image should return to its normal opacity 0.3</p>
<p>I have tried this but its not working correctly as it is stopped at last.</p>
<p>jquery:</p>
<pre><code>setInterval(function() {
$("#dis_image").html("");
$('#images_list :nth-child(1)').next().show().fadeOut(1200).appendTo('#dis_image');
$('#images :nth-child(1)').next().css({ opacity: 1 });
} , 5000);
</code></pre>
|
jquery
|
[5]
|
5,585,200 | 5,585,201 |
getting back to c# programming after dabbling in non tech world
|
<p>Whats the best way to get back and stay abreast to latest stuff going on with C#3/4?</p>
<p>I do have Jon Skeet's book</p>
|
c#
|
[0]
|
5,195,929 | 5,195,930 |
how to loop through an array of vectors in C#
|
<p>I now have an array of vectors:</p>
<pre><code>static Vector3[] axes =
new Vector3[] { Vector3.UnitX, Vector3.UnitY, Vector3.UnitZ };
</code></pre>
<p>and I want to loop through it,the code I write is:</p>
<pre><code>for(int i=0;i<axes.Length;i++)
{
do sth. about axes[i];
}
</code></pre>
<p>However,it doesnt work and gets into infinite loop,could anyone help?
thx. </p>
|
c#
|
[0]
|
320,539 | 320,540 |
Subtracting two chars and adding them to a string
|
<pre><code>#include <iostream>
#include <string>
int main() {
char s2;
s2 = '1' - '0';
std::cout << s2;
std::cout << std::endl;
std::cout << '1' - '0';
std::cin >> s2;
}
</code></pre>
<p>The output produced is:</p>
<pre><code>☺
1
</code></pre>
<p>My question is, why are the two lines different? I expected and wanted both results to be <code>1</code>. By my understanding they should be the same but that is obviously wrong, could somebody please explain this to me? Thank you</p>
|
c++
|
[6]
|
4,555,918 | 4,555,919 |
Can a native method call a private method?
|
<p>I knew that in JAVA "native" is a special thing. It can do a lot of things. But I'm not able to read it right now. I don't know how to... I knew it can call an other mathod in JAVA. My question is: can it call a private method? if it is a YES, then only in the same class or any other classes? if it can call other's, then is it a problem that maybe it's dangerous? that is, it broke the rules. Where can I get more about the NATIVE? can anybody show me a link?</p>
|
java
|
[1]
|
2,183,438 | 2,183,439 |
object ref in Java programming
|
<p>I want to know about the advantage in between the creating an object for sub class but assigning class A ref instead of assigning Class B ref. which is shown in line1,line2 below code </p>
<pre><code> class A
{
int b=10;
}
class B extends A
{
int b=12;
}
class Test
{
public static void main(String[] args)
{
A a=new B(); //line1
//B a=new B();//line2
System.our.println(a.b);
}
}
</code></pre>
|
java
|
[1]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.