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 |
---|---|---|---|---|---|
2,247,625 | 2,247,626 |
Which jQuery selector is more efficient?
|
<p>I was just wondering if there is a reason why I should prefer this</p>
<pre><code><div class="identifying-class">bla bla</div>
<div class="identifying-class">bla bla</div>
var interestingElements = $("div.identifying-class);
</code></pre>
<p>over this</p>
<pre><code><div data-identifying-attr="true">bla bla</div>
<div data-identifying-attr="true">bla bla</div>
var interestingElements = $("div[data-identifying-attr]");
</code></pre>
<p>Are attribute based selectors quicker /slower/the same speed as class based selectors?
Is one method deemed better practice than the other - if so why?</p>
|
jquery
|
[5]
|
82,479 | 82,480 |
How does Java draw text under Windows operating system?
|
<p>My question relates to the underlying rendering mechanism. Does it use Windows APIs e.g. drawtext, exttextout or does it use a proprietary drawing mechanism? Is this documented anywhere?</p>
<p>More specifically</p>
<pre><code>java.awt.Graphics.drawString
java.awt.Graphics2D.drawString
</code></pre>
<p>Under Sun JDK for windows</p>
|
java
|
[1]
|
5,040,572 | 5,040,573 |
typeof result of 2 undefined variable
|
<p>I just test the "typeof" in javascript, and really don't know why the result is like this. </p>
<p>/<strong><em>*</em>**<em>*</em></strong>/ </p>
<pre><code>var cota,
plouto;
alert(typeof plouto/cota); //NaN
</code></pre>
<p>/<strong><em>*</em>**<em>*</em></strong>/ </p>
<pre><code>var cota,
plouto;
alert(typeof (plouto/cota)); //number
</code></pre>
<p>/<strong><em>*</em>**<em>*</em></strong>/ </p>
<pre><code>var cota,
plouto;
var flo = plouto/cota;
alert(typeof flo); //number
</code></pre>
|
javascript
|
[3]
|
3,246,872 | 3,246,873 |
Passing function pointers - semantics
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/6893285/why-do-all-these-crazy-function-pointer-definitions-all-work-what-is-really-goi">Why do all these crazy function pointer definitions all work? What is really going on?</a> </p>
</blockquote>
<p>I would be grateful for an explanation why in the code</p>
<pre><code>void f(int& i)
{
i++;
}
void g(void (passed_f)(int&),int& a) //`passed_f` equivalent to `*passed_f`
{
passed_f(a);
}
int main()
{
int n=0;
g(f,n); //`f` is equivalent to `&f`
}
</code></pre>
<p>both of the equivalences hold, in the sense of not producing any errors, and giving exactly the same result, <code>1</code>. It seems, that it does not matter if we accept in <code>g</code> a pointer to a function, or a function itself... I also presume that [c]-tag is appropriate.</p>
|
c++
|
[6]
|
1,976,302 | 1,976,303 |
Filtering values against an expression and a list
|
<p>I'm writing a bot for the IMified network.</p>
<p>I want to filter the items processed by my bot by only accepting certain values into my script.</p>
<p>This is what I'm using right now:</p>
<pre><code>$items = array('botkey', 'userkey', 'network', 'user', 'channel', 'msg', 'step');
foreach ($_POST as $key => $value)
{
if (in_array($key, $items) || preg_match('value\d*', $key))
{
$this->data[$key] = $value;
}
}
</code></pre>
<ol>
<li>Is there any way to do this better?</li>
<li>Why doesn't my regular expression work – it is meant to only allow keys named like <code>value1234</code> or anything similar ("value" + number), but it doesn't let <em>anything</em> through.</li>
</ol>
|
php
|
[2]
|
3,886,321 | 3,886,322 |
The view controller of a uitabbarcontroller not getting refreshed
|
<p>i have a uitabarcontroller in which 3 view controller are added .in the 3rd tab i have a picker view which selects some settings based on which data in the 2nd tab changes.When i migrate into 2nd tab the data is not getting refreshed as i have the same old data.How can i refresh the data in the 2nd tab.</p>
<p>NSMutableArray *localControllersArray = [[NSMutableArray alloc] initWithCapacity:3];</p>
<pre><code>MainViewController *mainview;
mainview = [[MainViewController alloc] init];
mainview.tabBarItem.image=[UIImage imageNamed:@"pipeline.png"];
mainview.title=@"Pipeline";
navigationController = [[UINavigationController alloc] initWithRootViewController:mainview];
[localControllersArray addObject:navigationController];
[navigationController release];
[mainview release];
tabBarController.viewControllers = localControllersArray;
[self.view addSubview:tabBarController.view];
</code></pre>
<p>This is the way i have added 3 view controller to my tab controller in a view controller.</p>
|
iphone
|
[8]
|
5,043,532 | 5,043,533 |
how to find out android:requiresSmallestWidthDp for support-screens
|
<p>How do I figure what value to set the android:requiresSmallestWidthDp under
<p>I would like to support small screens, but I can see that at 3.3 in things start to get cut off.</p>
<p>I don't specify any sizes in the layout. Mainly use relative layout, and wrap_content.</p>
|
android
|
[4]
|
3,842,301 | 3,842,302 |
Asp.net MVC Medium Trust Remote Host
|
<p>I’m having issues getting my asp.net mvc application working on my remote host.</p>
<p>The host needs all sites to be working with medium trust.</p>
<p>I’ve modified my machine web.config “\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG” and created a new project so my new application web.config picks up the changes.</p>
<p><strong>Machine web.config</strong></p>
<pre><code> <location allowOverride="true">
<system.web>
<securityPolicy>
<trustLevel name="Full" policyFile="internal"/>
<trustLevel name="High" policyFile="web_hightrust.config"/>
<trustLevel name="Medium" policyFile="web_mediumtrust.config"/>
<trustLevel name="Low" policyFile="web_lowtrust.config"/>
<trustLevel name="Minimal" policyFile="web_minimaltrust.config"/>
</securityPolicy>
<trust level=" Medium " originUrl=""/>
</system.web>
</location>
</code></pre>
<p>When I upload to the host I get an error about System.Security.Permissions.ReflectionPermission and changing the trust level but when I click refresh I get an error about my route.</p>
<p>The route works fine locally so I can only put it down to the trust levels.</p>
<p>I may be missing something as I’ve not deployed to a remote host before.</p>
<p>Do I need to add anything to the website web.config?</p>
<p>Any help or advice would be great.</p>
<p>Also when I make a change to my machine web.config will my applcation pick up these settings when I next build in visual studio?</p>
|
asp.net
|
[9]
|
3,215,341 | 3,215,342 |
IPostbackeventhandler returning no results for an automated table
|
<p>I got this code which extends the tablerow to make them clickable. </p>
<pre><code>namespace ClickableTableRow
{
public class ClickableTableRow : TableRow, IPostBackEventHandler
{
public ClickableTableRow()
: base()
{ }
private EventHandler _click;
public event EventHandler Click
{
add { _click += value; }
remove { _click -= value; }
}
protected virtual void FireClickEvent()
{
if (_click != null)
_click(this, new EventArgs());
}
protected override void AddAttributesToRender(HtmlTextWriter writer)
{
writer.AddAttribute(HtmlTextWriterAttribute.Onclick,
Page.ClientScript.GetPostBackEventReference(this, String.Empty));
base.RenderAttributes(writer);
}
public void RaisePostBackEvent(string eventArgument)
{
FireClickEvent();
}
}
</code></pre>
<p>The code above works well if I create the table manually, but when i create the table in the code behind it seems to be firing postbacks but no resuts returned. is there any thing wrong i might doing. my codebehind looks like:</p>
<pre><code>public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void row1_Click(object sender, EventArgs e)
{
Messagebox.Text = "message";
}
ClickableTableRow.ClickableTableRow row1;
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
Table Table1 = new Table();
TableCell cell1 = new TableCell();
row1= new ClickableTableRow.ClickableTableRow();
row1.Attributes.Add("onmouseover", "this.style.cursor='hand'");
cell1 = new TableCell();
cell1.Text = "llllll";
row1.Cells.Add(cell1);
Table1.Rows.Add(row1);
row1.Click += new EventHandler(row1_Click);
this.pnl2.Controls.Add(Table1);
}
}
</code></pre>
|
asp.net
|
[9]
|
416,226 | 416,227 |
StreamCorruptedException when de-serializing through ObjectInputStream
|
<p>I am trying to test a program and for that I need to access ReadExternal function but I am getting StreamCorrupted exception on ObjectInputStream.
I know I need to use the object written by WriteObject but dont know how to do it...</p>
<pre><code>ObjectOutputStream out=new ObjectOutputStream(new ByteArrayOutputStream());
out.writeObject(ss3);
ss3.writeExternal(out);
try{
ByteInputStream bi=new ByteInputStream();
bi.setBuf(bb);
out.write(bb);
ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bb));
String s1=(String) in.readObject();
}
catch(Exception e){
e.printStackTrace();
}
</code></pre>
|
java
|
[1]
|
4,605,568 | 4,605,569 |
Is it possible to resize the canvas in android?
|
<p>[android]
I have a LinearLayout which contains 2 views, 1st is imageView and th 2nd one have canvas on it.
if I do mLinearLayout.addView(i); and then mLinearLayout.addView(c); it shows both but if I do it in reverse oder (mLinearLayout.addView(c) and then mLinearLayout.addView(i)) the it only shows canvas.
I wanted to share the screen between these 2 views. Can anybody help me on this?</p>
<pre><code>@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mLinearLayout = new LinearLayout(this);
mLinearLayout.setBackgroundColor(0xff74AC23);
ImageView i = new ImageView(this);
View c = new DrawView(this);
i.setImageResource(R.drawable.bol_groen);
i.setAdjustViewBounds(true);
mLinearLayout.addView(i);
mLinearLayout.addView(c);
setContentView(mLinearLayout);
}
</code></pre>
<p>}</p>
<p>public class DrawView extends View {</p>
<pre><code>private ShapeDrawable mDrawable;
public DrawView(Context context) {
super(context);
setFocusable(true); //necessary for getting the touch events
mDrawable = new ShapeDrawable(new OvalShape());
mDrawable.getPaint().setColor(0xff74AC23);
mDrawable.setBounds(x, y, x + width, y + height);
}
@Override protected void onDraw(Canvas canvas) {
canvas.drawColor(0xFFCCCCCC);
mDrawable.draw(canvas);
</code></pre>
<p>}</p>
|
android
|
[4]
|
748,292 | 748,293 |
Android Noteadv2. The confirm button has no click listener
|
<p>I'm looking at the Noteadv2 in the android tutorials. Everything works just hunky dory, but one small thing. My "confirm button" has no on-click listener. I know why this happens and the code from the solution is effectively identical, but the expectation the tutorial gives you is that you should be able to create and delete a note. So far.. no good.</p>
<p>So we start our call stack in creating the activity in Notepadv2.onMenuItemSelected(...). It says stuff like this:</p>
<pre><code>@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
switch(item.getItemId()) {
case INSERT_ID:
createNote();
return true;
}
return super.onMenuItemSelected(featureId, item);
}
</code></pre>
<p>Then our friend createNote() says:</p>
<pre><code> private void createNote() {
Intent i = new Intent(this, NoteEdit.class);
startActivityForResult(i, ACTIVITY_CREATE);
}
</code></pre>
<p>So android, so nicely, routes a request and CRUDs us a a NoteEdit class based on our manifest. All great so far. Here's the funny bit in NoteEdit.onCreate():</p>
<pre><code>@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.note_edit);
setTitle(R.string.edit_note);
mTitleText = (EditText) findViewById(R.id.title);
mBodyText = (EditText) findViewById(R.id.body);
Button confirmButton = (Button) findViewById(R.id.confirm);
mRowId = null;
Bundle extras = getIntent().getExtras();
if (extras != null) {
</code></pre>
<p>the last two lines are the crux. After this point we add a click event listener on the confirm button, which never gets done. </p>
<p>When we yank the extras out of the current intent for our activity, those extras are not there. Makes sense right? They were never set cuz this is new.. since the extras are null the if-statement drops out and we get stuck on the edit screen while debugging.</p>
<p>Is there a default setting I missed. Did I skip a step or is eclipse playing silly bugger again?</p>
<p>Thanks for reading.</p>
|
android
|
[4]
|
5,612,888 | 5,612,889 |
check for valid arguments
|
<p>So let's define a few functions:</p>
<pre><code>def x(a, b, c): pass
def y(a, b=1, c=2): pass
def z(a=1, b=2, c=3): pass
</code></pre>
<p>Now, what's the best way to, given a pointer to <code>x</code>, <code>y</code>, or <code>z</code> (<code>p</code>), a tuple of args (<code>a</code>) and a dictionary of kwargs (<code>k</code>), check to see if </p>
<pre><code>p(*a, **kw)
</code></pre>
<p>would produce any exception regarding having not enough arguments or incorrect arguments, etc—<em>without</em> actually calling <code>p(*a, **kw)</code> and then catching the exceptions raised.</p>
<h2>Example</h2>
<pre><code>def valid(ptr, args, kwargs): ... #implementation here
valid(x, ("hello", "goodbye", "what?"), {}) # => True
valid(x, ("hello", "goodbye"), {}) # => False
valid(y, ("hello", "goodbye", "what?"), {}) # => True
valid(y, (), {"a": "hello", "b": "goodbye", "c": "what"}) #=> True
valid(y, ("hello", "goodbye"), {"c": "what?"}) #=> True
</code></pre>
|
python
|
[7]
|
1,970,750 | 1,970,751 |
iPhone - content size of a UITableViewController
|
<p>I am on a view and I will show a TableViewController.</p>
<p>This app is universal. So, when I show this TableViewController on iPad I will show it inside a popover and on the iPhone I will push it with a navigationController.</p>
<p>Inside the tableViewController class I need to know the bounds of the parent view where this object is contained, that is the internal size of the popover (on the iPad) and the size of the view where the controller were pushed on the iPhone.</p>
<p>How do I access these values?
thanks</p>
|
iphone
|
[8]
|
3,874,493 | 3,874,494 |
Python Help, want to build a function without using Libraries
|
<p>I want to write a function that will return me the number of days between two dates somethinglike that <strong>def daysBetween(month1,dayofmonth1,month2,dayofmonth2)</strong>. Doesn't matter if the year is not included or not. But I DO NOT want to IMPORT LIBRARIES, cause I Know hoe to do it with Libraries. if any1 can help me to build the function and what loop i should be using, your help will be much appreciated. thanks</p>
|
python
|
[7]
|
5,056,258 | 5,056,259 |
Thinking of two elements as "the same"
|
<p>I have two jQuery elements, <code>$link = $('<a>')</code> and <code>$input = $('<input/>')</code>.</p>
<p>Although they are two different types of elements, they are in my code (and in my mind!) very linked:</p>
<p>1) Conceptually, they are different representations of one object.</p>
<p>2) They share the same attributes.</p>
<p>3) When one is displayed on the screen, the other is hidden.</p>
<p>Until now, I have used <code>.data()</code> to perform a link between the two:</p>
<pre><code>$link.data('$input', $input);
$input.data('$link', $link);
</code></pre>
<p>As my code became more and more complex, this solution has proved confusing and messy.</p>
<p>Is there a different approach I may want to consider? For example, is there a way to keep the attributes of the two elements continually synced? Is there a way to make one "meta-object" out of the two? etc.</p>
|
jquery
|
[5]
|
6,000,871 | 6,000,872 |
How do I resolve an Object not found error for the MSAS 2008:Memory object?
|
<p>I created a sample program in that I have written code to get details of particular performance objects Using PDH library function in native C++. However, I am getting error as "Object not found" for "MSAS 2008:Memory" object:</p>
<blockquote>
<p>PDH function PdhEnumObjectItems() is not able to find Object information of "MSAS 2008:Memory" object</p>
</blockquote>
<p>I checked that object in perfmon tool, and it is there.</p>
<p>Also I tried one <a href="http://msdn.microsoft.com/en-us/library/aa371886%28v=vs.85%29.aspx" rel="nofollow">MSDN sample program</a>, but this program is also not able to show "MSAS 2008:Memory" object.</p>
|
c++
|
[6]
|
3,000,638 | 3,000,639 |
Programatically recognize android alarm clock notification/ calender event notification
|
<p>Is it possible to get an event/broadcast, when calender/alarm clock, pops a notification?</p>
|
android
|
[4]
|
885,324 | 885,325 |
how to assign string array values to varible
|
<p>hi i am new to iphone. what i am doing is sorting the labels for that i am assigning the string array to temporary string variable as follows:</p>
<pre><code>NSString *tmp = [labels objectAtIndex:j-1];
labels[j-1]=labels[j];
labels[j] = tm;
</code></pre>
<p>but it shows error at last line that is incomplete types in assignment
how can i solve this?<br>
thank you</p>
|
iphone
|
[8]
|
2,291,692 | 2,291,693 |
Insert sentence to DB
|
<p>I'm working on ASP- and I have build in DB and I want to know how to write a code for insert sentences. on C#???</p>
|
c#
|
[0]
|
3,228,286 | 3,228,287 |
python datetime question
|
<p>I have a datetime where the input is hardcoded as <code>datetime.datetime(2008,5,5,16,20)</code></p>
<p>In the same format how to get the current datetime .I am using python 2.4 </p>
|
python
|
[7]
|
653,817 | 653,818 |
Timer is not implemented the first time
|
<p>I am trying to implement a timer and it works fine for the most part..
But for the first time , the clock isn't starting but for the rest of the activity it is,
The oncreate method has some problem which I am not able to figure out..Help!</p>
<pre><code>protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.friends);
Splash.one_time = false;
initilize();
mytime = new Thread() {
public void run() {
timer();
}
};
mytime.start();
mUpdateTimeTask = new Runnable() {
public void run() {
if (count_down > 0) {
if (count_down <= 5)
clock.setTextColor(Color.RED);
else
clock.setTextColor(Color.GREEN);
clock.setText(String.format("%d", count_down--));
mHandler.postDelayed(this, 1000);
} else {
clock.setTextColor(Color.RED);
clock.setText("0");
timeout();
}
}
};
}
private void timer() {
mStartTime = System.currentTimeMillis();
mHandler.removeCallbacks(mUpdateTimeTask);
mHandler.postDelayed(mUpdateTimeTask, 0);
}
</code></pre>
|
android
|
[4]
|
560,379 | 560,380 |
Getting error invalid assignment left-hand side
|
<p>i am suing a function in which i try to limit textarea length but on one condition i am getting the above mentioned error. Please tell me what i am doing wrong?</p>
<pre><code> function limitTextArea(element, limit) {
var $textArea = $(element);
($textArea).keypress(function(event){
if ($textArea.val().length == limit) {
event.preventDefault();
} else if ($textArea.val().length > limit) {
// Maximum exceeded
$textArea.val() = $textArea.val().substr(0, limit);
}
}); //end of keypress
} //end of function()
</code></pre>
<p>The line </p>
<pre><code>$textArea.val() = $textArea.val().substr(0, limit);
</code></pre>
<p>give me error that <code>invalid assignment left-hand side</code>. Why i am getting that? </p>
<p>Thanks</p>
|
jquery
|
[5]
|
1,834,350 | 1,834,351 |
How to run 'python setup.py install' from within Python?
|
<p>I'm trying to create a generic python script for starting up a python app and I would like to install any dependent python modules if they are missing from the target system. How can I run the equivalent of the command line command 'python setup.py install' from within Python itself? I feel like this should be pretty easy, but I can't figure it out. </p>
|
python
|
[7]
|
912,431 | 912,432 |
Javascript Game Engine
|
<p>I'm trying to write a javascript game engine myself. I did something like this;
How do you think can make it more useful? Waiting for suggestions. thanks</p>
<p>How do I write less than this initial code, for example?</p>
<pre><code> var jSgame = function(w,h,bgcolor){
if(bgcolor == undefined){
bgcolor = '#ccc';
}
this.bgcolor = bgcolor;
if(w==undefined){
w = 400;
}
if(h==undefined){
h = 200;
}
this.w = w;
this.h = h;
this.start = function(){
var c = document.createElement('canvas');
if(c){
c.style.backgroundColor = this.bgcolor;
c.width = this.w;
c.height = this.h;
document.body.appendChild(c);
this.ctx = c.getContext('2d');
}
}
}
jSgame.prototype.draw = function(x,y,bgcolor){
a = new jSgame(x,y,bgcolor);
a.start();
this.ctx = a.ctx;
this.rect=function(x,y,r,animate,clear,physics){
ctx = this.ctx;
var dx = 1;
if(!animate||!clear){
ctx.fillRect(x,y,r,r);
}else if(animate&&clear){
setInterval(function(){
ctx.clearRect(0,0,a.w,a.h);
ctx.fillRect(x,y,r,r);
x += dx;
if(physics){
if(x+dx>a.w-r){
dx=-dx;
}else if(x+dx<0){
dx=-dx;
}
}
},1);
}
}
}
Game = new jSgame();
Draw = new Game.draw(400,400,'#ccc');
Draw.rect(10,10,10,true,true,true);
</code></pre>
|
javascript
|
[3]
|
1,222,529 | 1,222,530 |
android.os.NetworkOnMainThreadException with android 4.2
|
<p>Here i am using this code load Json. It is work fine with android 2.2 but when i am using android 4.2 it throws <strong>android.os.NetworkOnMainThreadException</strong> exception please give me solution</p>
<pre><code> public class JSONParser {
static InputStream is = null;
static JSONObject jObj = null;
static String json = "";
// constructor
public JSONParser() {
}
public JSONObject getJSONFromUrl(String url) {
// Making HTTP request
try {
// defaultHttpClient
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpGet httpPost = new HttpGet(url);
HttpResponse getResponse = httpClient.execute(httpPost);
final int statusCode = getResponse.getStatusLine().getStatusCode();
if (statusCode != HttpStatus.SC_OK) {
Log.w(getClass().getSimpleName(),
"Error " + statusCode + " for URL " + url);
return null;
}
HttpEntity getResponseEntity = getResponse.getEntity();
//HttpResponse httpResponse = httpClient.execute(httpPost);
//HttpEntity httpEntity = httpResponse.getEntity();
is = getResponseEntity.getContent();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
Log.d("IO", e.getMessage().toString());
e.printStackTrace();
}
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(
is, "iso-8859-1"), 8);
StringBuilder sb = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null) {
sb.append(line + "\n");
}
is.close();
json = sb.toString();
} catch (Exception e) {
Log.e("Buffer Error", "Error converting result " + e.toString());
}
// try parse the string to a JSON object
try {
jObj = new JSONObject(json);
} catch (JSONException e) {
Log.e("JSON Parser", "Error parsing data " + e.toString());
}
// return JSON String
return jObj;
}
</code></pre>
<p>}</p>
<p>i am also using google api.</p>
|
android
|
[4]
|
5,467,671 | 5,467,672 |
img tag convert into div tag by using jQuery
|
<p>I want to change all img tag of a page into div tag by using jQuery.
ex.</p>
<pre><code><img src="http://www.xyz.com/img.png" alt="this text i want in div" />
</code></pre>
<p>by using jQuery it converts into </p>
<pre><code><div>this text i want in div</div>
</code></pre>
<p>How we can do this by using jQuery?</p>
|
jquery
|
[5]
|
5,628,462 | 5,628,463 |
Issue related to state maintenance
|
<p>I have 10 views with <code>UINavigationController</code> in hierarchy. Now when I want to go back from 10 to 9, and so on with back button, which method should I use?</p>
<ol>
<li><code>popviewController</code></li>
<li><code>popToViewController</code></li>
</ol>
<p>I have set a fixed value for all views. At application launch, I get that value. For that value I initialize <code>rootviewController</code> with use of <code>UINavigationController</code>. And my <code>rootviewController</code> is nothing but the first view and after that on next line, I'm pushing a particular view.</p>
|
iphone
|
[8]
|
3,461,653 | 3,461,654 |
Android 4.2.2 RSA disabling
|
<p>How to disable RSA autentification for android 4.2.2
I has tried following methods:</p>
<pre><code>1) setprop ro.adb.secure 0
getprop still return 1.
2) Root phone and retry method 1
getprop still return 1.
3) Root phone and manually change ro.adb.secure to 0 in the /default.prop
getprop still return 1.
</code></pre>
<p>Does anybody know how can I disable this check:</p>
<p><img src="http://i.stack.imgur.com/hDGxh.png" alt="enter image description here"></p>
|
android
|
[4]
|
1,287,806 | 1,287,807 |
Static variable definition order in c++
|
<p>Hi i have a class tools which has static variable std::vector m_tools. </p>
<p>Can i insert the values into the static variable from Global scope of other classes defined in other files. </p>
<p>Example: </p>
<p>tools.h File </p>
<pre><code>class Tools
{
public:
static std::vector<std::vector> m_tools;
void print()
{
for(int i=0 i< m_tools.size() ; i++)
std::cout<<"Tools initialized :"<< m_tools[i];
}
}
</code></pre>
<p>tools.cpp File</p>
<pre><code>std::vector<std::vector> Tools::m_tools; //Definition
</code></pre>
<p>Using register class constructor for inserting the new string into static variable.</p>
<pre><code>class Register
{
public:
Register(std::string str)
{
Tools::m_tools.pushback(str);
}
};
</code></pre>
<p>Different class which inserts the string to static variable in static variable</p>
<p>first_tool.cpp</p>
<pre><code>//Global scope declare global register variable
Register a("first_tool");
////////
</code></pre>
<p>second_tool.cpp</p>
<pre><code>//Global scope declare global register variable
Register a("second_tool");
</code></pre>
<p>Main.cpp</p>
<pre><code>void main()
{
Tools abc;
abc.print();
}
</code></pre>
<p>Will this work?</p>
<p>In the above example on only one string is getting inserted in to the static list. Problem look like "in Global scope it tries to insert the element before the definition is done"
Please let me know is there any way to set the static definiton priority? Or is there any alternative way of doing the same.</p>
|
c++
|
[6]
|
616,412 | 616,413 |
How to snoop on $("<p>") calls?
|
<p>I was wondering how i snoop on dom modification events. I tried using the $.sub() to listen but it seems a little overfill to use another wrapper from jquery to get this affect. </p>
<p>Demo is here <a href="http://jsfiddle.net/sr5RE/2/" rel="nofollow">http://jsfiddle.net/sr5RE/2/</a></p>
<p>i.e this works</p>
<pre><code>var $sub = jQuery.sub();
$sub.fn.init = function(selector){
alert("Success");
return $.fn.init.apply($sub.fn.init, arguments);
};
$sub("<p/>");
</code></pre>
<p>but calling $ then it doesn't</p>
<pre><code>$("<p/>");
</code></pre>
<p>And obviously this will loop</p>
<pre><code>$.fn.init = function(selector){
alert("Success");
return $.fn.init.apply($sub.fn.init, arguments);
};
$("<p/>");
</code></pre>
<p>Any ideas?</p>
|
jquery
|
[5]
|
1,247,776 | 1,247,777 |
ASP.Net Wizard - How to clear contents of web controls
|
<p>I have an ASP.NET wizard control where I loop back, <code>wiz.MoveTo(wiz.WizardSteps[0])</code>, to the first step in the wizard in the FinishButtonClick event handler.</p>
<p>I then also want to clear all content for all controls in the steps?</p>
<p>The problem is that because of viewstate the controls in the wizard steps remember their
values from the previous submission?</p>
<p>I cannot use enableviewstate=false on controls as they need to be able to remember their state (back and forth) between steps?</p>
<p>What is the easiest way to clear the viewstate of all controls only when the FinishButtonClick event occurs?</p>
<p>Thanks!</p>
|
asp.net
|
[9]
|
1,059,315 | 1,059,316 |
Avoid to rewrite a file that already exists
|
<p>I write this simple code to save an image:</p>
<pre><code>// $randomimage contains a random image url.
$content = file_get_contents($randomimage);
file_put_contents('images/'.$randomimage, $content);
</code></pre>
<p>I need a way to NOT rewrite an image with the same name. So, if an image with a certain name already exist in my /images/ folder, then do NOTHING.
It's simple but I don't know how to do that.</p>
|
php
|
[2]
|
5,020,487 | 5,020,488 |
URL routing - opposite of GetRouteUrl in Asp.net webform
|
<p>Assume I have the following defined in global.asax:</p>
<pre><code>routes.MapPageRoute("about", "about", "~/About.aspx");
</code></pre>
<p>In an ashx file, I want to be able to pass in "about" and return "~/About.aspx". I know the opposite can be done via GetRouteUrl, but is there a built-in function for what I'm looking to do?</p>
|
asp.net
|
[9]
|
1,552,966 | 1,552,967 |
How to specify height of view to be 1/3 of screen height
|
<p>I have created a view (actually a webview):</p>
<pre><code><WebView
android:id="@+id/myWebView"
android:layout_width="match_parent"
android:layout_height="@dimen/input_height"
/>
</code></pre>
<p>Which refers to the height in another xml file:</p>
<pre><code><resources>
<dimen name="key_height">50dip</dimen>
<dimen name="candidate_font_height">16sp</dimen>
<dimen name="candidate_vertical_padding">6sp</dimen>
<dimen name="input_height">280dip</dimen>
</resources>
</code></pre>
<p>Where I have set the <code>input_height</code> as <code>280dip</code> which I understand to mean 280 pixels (device independently) of an approximately 320 pixel (or emulated 320ish pixel) height.</p>
<p>On my two devices (small sony ericsson xperia x10 mini with 320 pixel screen, and old htc desire), it works fine, providing a view height of approximately 1.3 of the screen height. One of my testers is using a samsung galaxy S and they are reporting that the view takes up more than the entire screen.</p>
<p>I assume the issue is something to do with screen density, but I thought using <code>dip</code> would circumvent that issue.</p>
<p>How should I define my layout view to avoid this problem?</p>
|
android
|
[4]
|
4,842,812 | 4,842,813 |
year in 2year format
|
<p>How do I get the following to show in a 2 digit year format?</p>
<pre><code>DateTime test = DateTime.Now;
DateTimeFormatInfo dateTimeFormat = CultureInfo.GetCultureInfo("en-US").DateTimeFormat;
Console.WriteLine(test.ToString(dateTimeFormat.ShortDatePattern,dateTimeFormat));
</code></pre>
|
c#
|
[0]
|
5,771,604 | 5,771,605 |
ANDROID: update runtime contextmenu : add item to context menu after event
|
<p>hi mate how can i update runtime my context menu ?
after some events i have to add item to context menu.
normal menu has got on onPrepareOptionsMenu(). but context menu have only oncreateCOntextmenu().
how can update my context menu ?</p>
|
android
|
[4]
|
5,639,006 | 5,639,007 |
icon issue in android
|
<p>i have developed one application in which getting <strong><em>install app information</em></strong> like name,package name, version,date, icon etc..
now i get all thing in proper manner, nut icon are store in <strong>"private Drawable icon;"</strong> variable.
now i am drag <code><imageview></code> in main file and display those icon in this file so what i need to do?</p>
|
android
|
[4]
|
1,792,563 | 1,792,564 |
Correlation between Memory Usage of Processes and battery Consumption Android
|
<p>I've finally figured out a way to get TotalPss for individual processes. Now what I am concerned about is, how to find battery consumption per android process, and if there is no direct way of finding that out, is there any correlation between the memory usage per process and the battery consumption? Any research paper that I can look into for that?</p>
|
android
|
[4]
|
4,824,652 | 4,824,653 |
Edittext want to go enable from disable after select the particular item in the spinner items
|
<p>I'm using Spinner,EditText and Button in one page.The spinner has these items ... </p>
<p>Following:</p>
<pre><code> String[] Items = {
"Alarm",
"Office",
"Meeting",
"Party",
"Lunch",
"Breakfast",
"Supper",
"Home",
"Private",
"Outdoor",
"Family",
"Friends",
"others"
};
Spinner s1;
</code></pre>
<p>In it if I select the "others" in spinner items means only the Edittext has to be enable otherwise it has to be disabled.If I select some other item Edittext has to be disabled</p>
<p>Code snippet:</p>
<pre><code>s1 = (Spinner) findViewById(R.id.spinner);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item, Items);
s1.setAdapter(adapter);
s1.setOnItemSelectedListener(new OnItemSelectedListener()
{
public void onItemSelected(AdapterView<?> arg0,
View arg1, int arg2, long arg3)
{
int index = s1.getSelectedItemPosition();
Toast.makeText(getBaseContext(),
"You have selected item : " + Items[index],
Toast.LENGTH_SHORT).show();
}
public void onNothingSelected(AdapterView<?> arg0) {}
});
</code></pre>
<p>Thank you, </p>
|
android
|
[4]
|
4,022,290 | 4,022,291 |
Exception in thread "main" java.lang.NullPointerException
|
<p>I started to learn java yesterday and I wrote the followind program which should print pairs of equal numbers, but when I run it I get </p>
<pre><code>Exception in thread "main" java.lang.NullPointerException
at _aaaa.main(_aaaa.java:26)
</code></pre>
<p>Here is my program:</p>
<pre><code>import java.util.*;
class pair {
int first, second;
pair() {
first = second = 0;
}
public void make_pair(int a, int b)
{
first = a;
second = b;
}
}
public class aaaa {
public static void main(String[] idontneedthis)
{
Scanner input = new Scanner(System.in);
int N = input.nextInt(), i, lg = 0;
int[] A = new int[5010];
pair[] B = new pair[5010];
for (N <<= 1, i = 1; i <= N; ++i)
{
int var = input.nextInt();
if (A[var] > 0)
{
B[++lg].make_pair(A[var], var);
A[var] = 0;
}
else
{
A[var] = i;
}
}
if (lg == 0) System.out.print("-1");
for (i = 1; i <= lg; ++i)
{
System.out.print(B[i].first + " " + B[i].second + "\n");
}
}
}
</code></pre>
<p>Please tell me what is wrong or why do I get this error. I mention that if I cut the line 26 ( <code>B[++lg].make_pair(A[var], var);</code> ) it will write -1.</p>
<p>Thank you!</p>
|
java
|
[1]
|
4,174,278 | 4,174,279 |
jQuery in Wordpress - Why is it not working?
|
<p>I am using this as my starter template: <a href="http://html5reset.org/" rel="nofollow">www.html5reset.org/</a></p>
<p>It's pretty nice, but I believe something is wrong with jQuery in there.</p>
<p>In the <code>functions.php</code> it says:</p>
<pre><code>// Load jQuery
if ( !function_exists(core_mods) ) {
function core_mods() {
if ( !is_admin() ) {
wp_deregister_script('jquery');
wp_register_script('jquery', ("//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"), false);
wp_enqueue_script('jquery');
}
}
core_mods();
}
</code></pre>
<p>This seems fine to me - is it alright?</p>
<p>There also is a premade JS file. In this file it says:</p>
<pre><code>// remap jQuery to $
(function($){})(window.jQuery);
</code></pre>
<p>I don't know really what this does, but it seems also ok.</p>
<p>To test if jQuery works, I tried the following - none of it is woking, jQuery is not defined.</p>
<pre><code>$(document).ready(function() {
alert("This is a test.");
});
jQuery(document).ready(function() {
alert("This is a test.");
});
$(document).ready(function($) {
alert("This is a test.");
});
</code></pre>
<p>So, can you tell ma what could be wrong with this? Thank you!</p>
|
jquery
|
[5]
|
525,384 | 525,385 |
Android - Draw bitmap as one color
|
<p>I have several bitmaps (game sprites) which I'd like to draw into another bitmap, however each non-transparent pixel of the source bitmap should be drawn using a single color, ignoring the original pixel color of the source. Basically, I'm trying to use the sprite as a "stamp" of a single color to be drawn into the destination bitmap.</p>
<p>I believe I should be using canvas.drawBitmap (Bitmap bitmap, Matrix matrix, Paint paint), however I'm not exactly sure how I should initialize the paint object. Is this approach correct?</p>
|
android
|
[4]
|
180,476 | 180,477 |
jQuery mousedown + mouseleave
|
<p>i'm a begginer currently building a simple jQuery script where i'd like my action to happen when I drag out of its bounds. So i was thinking on detecting a mousedown and inside its function have a mouseleave.</p>
<p>But what happens is not what i'm expecting since everytime i pass my mouse over it - no need to click, the event gets triggered.</p>
<p>Here's the code i've put toghether.</p>
<pre><code> $(document).ready(function() {
$(".box").mousedown(function() {
$(".box").mouseleave(function() {
alert("Hello world!");
});
});
});
</code></pre>
<p>Help much appreciated, thanx!</p>
|
jquery
|
[5]
|
5,437,284 | 5,437,285 |
Where the PHP $_GET superglobal can be used
|
<p>Can the PHP superglobal $_GET be used and work as intended outside of the form tags? For example, can I do $_GET('select box id') outside of the form tags and have it work as intended?</p>
<pre><code><?php
---Placeholder for DB login info---
switch($_GET['select box id'])
{
case "text shown for second option of select box":
$query = mysql_query("placeholder for actual query");
$row = mysql_fetch_row($query);
$textboxValue = $row[0];
break;
}
?>
</code></pre>
|
php
|
[2]
|
4,377,097 | 4,377,098 |
add a menu to my application with android
|
<p>I created a file option_menu.xml: in the directory /res/menu/</p>
<p>I created a file menu.java that contains this code: </p>
<pre><code> @Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.option_menu, menu);
return true;
}
</code></pre>
<p>where I can put this code for my menu works?(In menu.java?</p>
<pre><code>@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.nelp:
help();
return true;
case R.id.quit:
quit();
default:
return super.onOptionsItemSelected(item);
}
}
</code></pre>
<p>My application contains 4 java files </p>
<p>I Hope the menu to be accessible at any Activity.</p>
<p>Thank you in advance</p>
|
android
|
[4]
|
4,144,979 | 4,144,980 |
Detect height change of a DIV with jQuery using Resize Plugin
|
<p>I'm using this plugin to check if a size of a DIV is changed:</p>
<p><a href="http://benalman.com/projects/jquery-resize-plugin/" rel="nofollow">http://benalman.com/projects/jquery-resize-plugin/</a></p>
<p>And it works just fine, but I don't want to just detect if a DIV is resized, I want to detect if the height of a DIV is increased or reduced!</p>
<p>How this could be achieved?</p>
<p>Thanks</p>
|
jquery
|
[5]
|
4,697,616 | 4,697,617 |
confise when to release memory
|
<p>i have created one view Controller(A) and this controller is using as a view in my app means i am adding view controllers view property to other view controller(B) view property.
in this case should i release A or their view after adding to b ........??
or relese A controller in dealloc method ???</p>
|
iphone
|
[8]
|
4,981,774 | 4,981,775 |
Time Ago Help
|
<p>On following function i used 2 identical variables because inside is different language, i need help to replace this variable $periods[$j].= "";</p>
<p>example:</p>
<pre><code>function showdate($time)
{
$periods = array("second", "minute", "hour", "day", "week", "month", "year", "decade");
$periods2 = array("seconds", "minutes", "hours", "days", "weeks", "months", "years", "decade");
$lengths = array("60","60","24","7","4.35","12","10");
$now = time();
$difference = $now - $time;
$tense = "ago";
for($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++)
{
$difference /= $lengths[$j];
}
$difference = round($difference);
if($difference != 1)
{
**/* In this case i need to show me this variable $periods2 */**
$periods[$j].= "";
}
return "$difference $periods[$j] $tense";
}
</code></pre>
|
php
|
[2]
|
6,004,376 | 6,004,377 |
Page Initialization: Does one need onload?
|
<p>Regarding this <a href="http://stackoverflow.com/questions/886668/window-onload-is-not-firing-with-ie-8-in-first-shot">SO</a> article and this <a href="http://stackoverflow.com/questions/5168022/the-window-onload-event-is-not-firing-in-ie8">SO</a> article. I looked at these after noticing my web app does not fire in IE8...I don't care about backward compatibility at the moment but if it's one line of code why not? Anyways the other issue I was having is the onload event waits for all the content to load...so the user has no controls if he/she is waiting for images to download. This led me to believe that I should just use</p>
<pre><code><script type='text/javascript'>my_initialize_function()</script>
</code></pre>
<p>placed in the html where I want the page to initialize.</p>
<p>and say to bye to</p>
<pre><code>window.onload = initializePage;
</code></pre>
<p>or</p>
<pre><code>window.addEventListener('load',initialize_page);
</code></pre>
<p>or any similar.</p>
<p>My question is: Is this a valid approach to initializing one's page?</p>
<p>PS: I'm not using any libraries including JQuery...and obviously I would not try to initialize elements that have not been loaded yet.</p>
|
javascript
|
[3]
|
4,684,091 | 4,684,092 |
Assist with Python script
|
<p>I have written a code in Python, and I want to change it.
I use it when I am performing a penetration tests in my organization and I want to make my script better.
The script gets a username that I entering and it connect to the SMTP server over port 25 and check if the user exists or not.
Here is the script:</p>
<pre><code>#!/usr/bin/python
import socket
import sys
if len(sys.argv) != 2:
print "Usage: vrfy.py <username>"
sys.exit(0)
# Create a Socket
s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Connect to the Server
connect=s.connect(('192.168.0.10',25))
# Recieve the banner
banner=s.recv(1024)
print banner
# VRFY a user
s.send('VRFY ' + sys.argv[1] + '\r\n')
result=s.recv(1024)
print result
# Close the socket
s.close()
</code></pre>
<p>The changes that I want to perform are the following:
Instead of entering only one username to check, I want to mention a location of a txt file and the script will read all the usernames it contains.</p>
<p>Also, I what that the IP address at the script wont be hard coded and I will need to insert it every time I am using the script.
Many thanks in advance,</p>
<p>Bar Aviv</p>
|
python
|
[7]
|
2,897,763 | 2,897,764 |
C# Language Question: priority of matching
|
<p>I'm reading book "C# Language", and hit this example from Page 123-124:</p>
<p>The meaning of a name within a block may differ based on the context in which the name is used. </p>
<p>In the example</p>
<pre><code>using System;
class A { }
class Test
{
static void Main()
{
string A = "hello, world";
string s = A; // Expression context
Type t = typeof(A); // Type context
Console.WriteLine(s); // Writes "hello, world"
Console.WriteLine(t); // Writes "A"
}
}
</code></pre>
<p>the name A is used in an expression context to refer to the local variable A and in a type
context to refer to the class A.</p>
<p>I'm fine with the visibility of class A. However, here (<code>Type t = typeof(A)</code>) class <code>A</code> preceded string <code>A</code>.
So, what is the "priority" or "sequence" of matching/choosing a possible "A"?</p>
|
c#
|
[0]
|
228,889 | 228,890 |
Android change widget color at runtime UPDATED
|
<p>I have a widget, with a framelayout.</p>
<p>Is there a way to change my widgets color/shape in runtime? </p>
<p>I am using a shape xml for the background. </p>
<p><strong>update:</strong></p>
<p>i tried:
1,</p>
<pre><code> Paint paint=new Paint();
Bitmap bitmap=Bitmap.createBitmap(100, 100, Config.ARGB_8888);
Canvas canvas=new Canvas(bitmap);
paint.setColor(Color.RED);
canvas.drawRoundRect(new RectF(1,1,111,111), 10, 10, paint);
updateViews.setImageViewBitmap(R.id.FL, bitmap);
</code></pre>
<p>--> error loading widget</p>
<p>2, </p>
<pre><code>updateViews.setImageViewResource(R.id.FL, R.drawable.blue);
</code></pre>
<p>--> error loading widget</p>
|
android
|
[4]
|
2,655,299 | 2,655,300 |
What is the purpose of marker interface?
|
<blockquote>
<p><strong>Possible Duplicates:</strong><br>
<a href="http://stackoverflow.com/questions/4540820/marker-interface">marker interface</a><br>
<a href="http://stackoverflow.com/questions/1023068/what-is-the-purpose-of-a-marker-interface">What is the purpose of a marker interface?</a> </p>
</blockquote>
<p>I know what is marker interface - An interface with no methods.
Example: Serializable, Remote, Cloneable.</p>
<p>I am wondering what is the purpose of marker inteface. This is my understanding:-</p>
<p>Basically it is just to identify the special objects from normal objects. Like in case of serialization , objects that need to be serialized must implement serializable interface and down the line writeObject() method must be checking somewhere if it is a instance of serializable or not. As far as i think ,Thats the only purpose for which writeObject using interface serializable(marker interface). Right? or jvm provides some extra functionality too on the basis of serializable interface?</p>
<p>Similar kind of logic is true for cloneable interface.</p>
<p>Now lets see how it is useful.</p>
<p>Lets say in a application we have 1000 value objects.We want to serialize only 100 specific objects . Now JDK has said that programmer role is just to mark the object as special with marker interface in this case its serializable interface.Now JDK will take care of that which object to serialize or not?</p>
<p>Yes we could achieve this kind of behaviour with some kind of bollean flag . but that
would be a bad approach.</p>
<p>Similarily we can say in case of user defined marker interface , we can distinguish special objects with help of marker interface.Like we can use instance of operator to determine if it is a instance of that particular interface . If yes proceed in case of No throw some exception.</p>
<p>Please let if above understanding is correct?</p>
|
java
|
[1]
|
4,331,503 | 4,331,504 |
In c# what does the ^ character do?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/3735623/what-are-the-and-operators-used-for">What are the | and ^ operators used for?</a> </p>
</blockquote>
<p>In c# what does the ^ character do?</p>
|
c#
|
[0]
|
4,762,872 | 4,762,873 |
Hashmap error,i can't load data from string
|
<p>I m using hashmap for a listview.</p>
<pre><code> map = new HashMap<String, Object>();
map.put("name", R.string.information);
map.put("address", R.drawable.info3);
mylist.add(map);
// ...
</code></pre>
<p>my problem is that i cant load string in my hashmap (R.string.information)..when i run it,i can only see some numbers instead of my text..am i doing something wrong?thanks </p>
<pre><code> <string name="information">Informations</string>
</code></pre>
|
android
|
[4]
|
4,006,432 | 4,006,433 |
How to share same data between multiple activities in android?
|
<p>How to share same data b/w multiple activities.Present i'm using Intent but it is not working properly. It means for some activities i need to pass some other data at that time common data which i need to pass that data is losing . so how can i overcome this problem .Please help me regarding this.</p>
<p>Thanking you.</p>
|
android
|
[4]
|
4,620,012 | 4,620,013 |
using stripslashes() discriminately
|
<p>My php application uses stripslashes() to deal with magic_quotes but I only want it to remove slashes that magic_quotes is putting in, because the user is allowed to supply a \ with his input.</p>
|
php
|
[2]
|
844,110 | 844,111 |
How to determine if the flight segment is transatlantic or transpacific in PHP?
|
<p>Given the airport code for the origin and destination region of a flight I need to determine if this flight segment is transpacific or transatlantic. </p>
<p>This is the psuedocode of the best solution I came up with so far.</p>
<p>1.determine the country and the continent(region) of the airport codes.
2.If the origin region is America and the destination region is Europe or Africa or vice versa, the flight segment is transatlantic.
3.If the origin region is America and the destination region is Asia-Pacific or Australia or vice versa, the flight segment is transpacific.</p>
<p>I am not 100% confident of this algorithm. </p>
<p>Can anyone recommend an algorithm, a webservice or any kind of tool to determine if a flight segment is transpacific or transalantic? I am using PHP.</p>
|
php
|
[2]
|
5,416,878 | 5,416,879 |
question related to array
|
<p>I have two array. and I want to concatenate to following format. format is shown as follows. </p>
<pre><code> Getting form values using post method
/************ Getting Form names like Weight,arms Age etc **********************/
foreach ($_POST["form_field_names"] as $key => $values) {
$form_field_name = $values;
}
/************ Getting Form Values like 45,90,2 **********************/
foreach ($_POST["form_field_values"] as $key => $values) {
$form_field_values[] = $values;
}
Array
(
[0] => Age
[1] => Weight
[2] => Arms
)
Array
(
[0] => 45
[1] => 90
[2] => 2
)
</code></pre>
<p>Want to concatenate to following format</p>
<pre><code>$output = $Age.","."45".",".$Weight.","."90".",".$Arms.","."2".",";
</code></pre>
<p>Is it possible? thanks</p>
|
php
|
[2]
|
4,154,245 | 4,154,246 |
how to add naviagationController to tabBar Controller programatically?
|
<p>In AppDelegate.m i am writing following code for navigationbar.</p>
<pre><code>MaterialsListViewController *materials = [[MaterialsListViewController alloc]initWithNibName:@"MaterialsListView" bundle:nil];
UINavigationController *navigation = [[UINavigationController alloc]initWithRootViewController:materials];
</code></pre>
<p>In the same AppDelegate.m i am writing follwing code for tabbar. </p>
<pre><code>UIViewController *viewController1, *viewController2;
viewController1 = [[[MaterialsListViewController alloc] initWithNibName:@"MaterialsList" bundle:nil] autorelease];
viewController2 = [[[RecentMaterialsListViewController alloc] initWithNibName:@"RecentMaterialsList" bundle:nil] autorelease];
self.tabBarController = [[[UITabBarController alloc] init] autorelease];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, viewController2, nil];
NSArray *items = self.tabBarController.tabBar.items;
UITabBarItem *item1 = [items objectAtIndex:0];
[item1 setTitle:@"Materials"];
UITabBarItem *item2 = [items objectAtIndex:1];
[item2 setTitle:@"Recent"];
self.window.rootViewController = self.tabBarController;
</code></pre>
<p>How to add NavigationBar to the tabbar?</p>
|
iphone
|
[8]
|
3,722,663 | 3,722,664 |
Set Dialog Theme to Activity in Android using programming code
|
<p>I want to set a <strong>Dialog Theme</strong> to an <strong>Activity</strong>.
I can achieve this using <strong>Manifest File</strong>.
But I want to set it using programming code.</p>
<p>How I can achieve this ?</p>
<p>Thanks.</p>
|
android
|
[4]
|
3,854,541 | 3,854,542 |
how do i create and save a data file in a folder of my choice
|
<p>how do i create and save a data file in a folder of my choice in C++ program?</p>
|
c++
|
[6]
|
3,315,422 | 3,315,423 |
startsWith using error in java
|
<p>defined variable:</p>
<pre><code> LinkedList list1=new LinkedList();
</code></pre>
<p><code>Object get()</code> in list1 obtains a node of list1</p>
<p><code>Object remove()</code> in list1 deletes a node of list1</p>
<p><code>count()</code> is length of list1</p>
<pre><code>for(int i=1;i<list1.count();i++){
if(list1.get(i).startsWith('"',0)) //Error here
list1.remove(i);
}
</code></pre>
<p>Error: cannot find symbol</p>
<blockquote>
<p>symbol: method charAt(int)<br>
location: class Object</p>
</blockquote>
<p>how to fix this problem?
I would like to delete the node in list1 which starts with (").</p>
|
java
|
[1]
|
4,825,190 | 4,825,191 |
Bytes in Java?
|
<p>Thanks for all above answers but didn't really help me well just to give an idea what exactlty i wants to do: I am coding for some sort of packet which has different fields with differnt length in bytes</p>
<p>so field1 is 2 byte long field2 is 3 bytes long field3 is 6 bytes long and when i addup these fields, i should be getting 11 bytes in length...</p>
<p>But i have no idea how can i declare something with this byte long...</p>
<p>Please help...thanks in advance</p>
|
java
|
[1]
|
4,946,220 | 4,946,221 |
java Integer reference
|
<p>I've got a question.</p>
<pre><code>public class Jaba {
public static void main(String args[]) {
Integer i = new Integer(0);
new A(i);
System.out.println(i);
new B(i);
System.out.println(i);
int ii = 0;
new A(ii);
System.out.println(ii);
new B(ii);
System.out.println(ii);
}
}
class A {
public A(Integer i) { ++i; }
}
class B {
public B(int i) { ++i; }
}
</code></pre>
<p>To my mind passing an int\Integer as Integer to a function and making ++ on that reference should change the underlying object, but the output is 0 in all the cases. Why is that?</p>
|
java
|
[1]
|
1,301,370 | 1,301,371 |
Listen to the Delete action in AddressBook ShowPersonViewController on iPhone
|
<p>I am writing a dialler application and am i trying to integrate the AddressBook with it. I want to allow the user to Edit the contact directly from within my application but i want to be able to listen to those modifications, if possible. Say for example the user click the delete button in the ShowPersonViewController and the contact is deleted. I want to inform my application that contact X has been deleted. Or some detail in contact Y have been modified. Will i be able to achieve this?</p>
<p>Cheers
AF </p>
|
iphone
|
[8]
|
3,447,974 | 3,447,975 |
How to propagate a value back to the enclosing class in Java?
|
<p>I was looking at this example<a href="http://stackoverflow.com/questions/1703351/how-to-call-a-oracle-function-from-hibernate-with-return-parameter"> Oracle function from Hibernate</a>. It tells in the solution that:</p>
<pre><code>int result = call.getInt(1); // propagate this back to enclosing class
</code></pre>
<p>Can anyone point me to how this can be done?</p>
|
java
|
[1]
|
2,923,511 | 2,923,512 |
How to display indexDB data on initial page rendering
|
<p>I have a Web page using JavaScript where I cache a large amount of data which I use to populate option tags of a select statement. I have implemented this using localStorage but it is very very slow (it would be much faster regenerating/reloading from the server). IndexDB looks promising as a solution.</p>
<p>All the examples I have been able to find have an indexDB database open, upgrade (configure/load) if necessary. However, to display the indexDB data, the examples implement a button with an onclick function. What I want is to display the indexDB data on the 1st rendering of the page (to load option tags of a select statement).</p>
<p>I have tried to do this but it seems because of the asynchronous callbacks make me unable to create a transaction on the initial rendering of the page hence unable to read the indexDB data.</p>
<p>Is there a way to read the indexDB data on 1st page rendering?</p>
<p>Thanks! </p>
|
javascript
|
[3]
|
4,341,961 | 4,341,962 |
jQuery: Trying to run $.get within .each function
|
<p>This code does get the index value of each element with the "profileName" class. It also does run a $.get using each index value as the url. But it fails when I try to make it put the ajax response into each element with the "details" class that is the child element of each "profilName" div. Is this doable? </p>
<pre><code>$('.profileName').each(function(index) {
var urlVal = $(".showProfile", this).attr('profile');
$.get(urlVal, function(data) {
$(".details", this).html(data);
}, "html");
});
</code></pre>
|
jquery
|
[5]
|
473,815 | 473,816 |
How to loop through :eq for an unknown range using jquery?
|
<p>How to loop through a jquery each loop using filter :eq for an unknown range?</p>
<p>for example, I would like to loop through the following:</p>
<pre><code>$("#list li:eq("+ i +")").each(function(i)
{
i++;
});
</code></pre>
<p>This code does not work</p>
|
jquery
|
[5]
|
30,592 | 30,593 |
Jquery: getting value of input checkbox using common class and change()
|
<p>I have a table of values and need to get the value of a row's checkbox. What is happening is:
If I have a table with 4 rows of data and select the top row, the binding event is being fired for each corresponding row in the table with the same class name. I only want it to fire once and return the value of the row's checkbox that was changed (need both checked and unchecked trigger). Any help is appreciated.</p>
<p>See my fiddle at <a href="http://jsfiddle.net/radi8/MgFuu/5/" rel="nofollow">http://jsfiddle.net/radi8/MgFuu/5/</a>.</p>
<p>I am using the following class (fixed using suggestions by Rob W and Richard D, thanks guys!):</p>
<pre><code> var RequiredField = {
init: function() {
// bind a control structure around the PSN selection table
var psn = $(".psnselect");
//for (var i = 0, ii = psn.length; i < ii; i++) {
// $(psn).change(RequiredField.psnSelect);
//}
psn.change(RequiredField.psnSelect);
},
psnSelect: function(event) {
var evtName = event.currentTarget.name;
var checked = event.currentTarget.checked;
var val = event.currentTarget.value;
alert('PSN Selection: ' + evtName);
}
};
RequiredField.init();
</code></pre>
|
jquery
|
[5]
|
5,147,708 | 5,147,709 |
Jquery slide need content to stay open on hover
|
<p>Im having trouble with my jquery slide.</p>
<pre><code>$(document).ready(function()
{
$(".events").hover(function()
{
$(this).next().slideToggle(400);
}, function() {
$(this).next().slideToggle(400);
});
});
</code></pre>
<p>When i hover over my image, the hiden content slides out and when im not hovered it slides in, thats great but i need to minipulate it so that the hidden content will stay open when i hover over the content and not just the image.
can anyone help me, im new to web desighn and have been stuck on this for some time.
Thanks in advance. </p>
<p>I spoke too fast, i tryied the solution above and its not working. My slide wont even open and its stoped all the other slides on my page from opening when i only changed one of them not sure what the problem is. this is my html:</p>
info text goes here
<p>– </p>
<p>Hi thebiffboff i copied my html and css to the fiddle link u sent and used the solution you showed me and it worked perfectly but it wont in my own page, how could i go about looking for the problem</p>
|
jquery
|
[5]
|
3,649,785 | 3,649,786 |
Android - failed to open zip archive
|
<p>I am downloading apk file from web and storing him into Context.getCacheDir(). I am downloading file by HttpURLConnection - I am not asking actually on the code (it is fully working), so I am not posting it here. I successfully initiate download. File is downloaded into cache and then is prompted installation - but system cannot open my APK and writes error of analysis.</p>
<p>Hence problem is as follows:</p>
<pre><code>03-31 16:48:43.740: INFO/ActivityManager(59): Start proc com.android.packageinstaller for activity com.android.packageinstaller/.PackageInstallerActivity: pid=620 uid=10026 gids={}
03-31 16:48:44.749: WARN/zipro(620): Unable to open zip '/data/data/com.my.app/cache/myApp.apk': Permission denied
03-31 16:48:44.749: DEBUG/asset(620): failed to open Zip archive '/data/data/com.my.app/cache/myApp.apk'
03-31 16:48:44.930: WARN/PackageParser(620): Unable to read AndroidManifest.xml of /data/data/com.my.app/cache/myApp.apk
03-31 16:48:44.930: WARN/PackageParser(620): java.io.FileNotFoundException: AndroidManifest.xml
</code></pre>
<p>Problem is - I don't have permission to access programaticaly /cache. Is there any way how to solve it? I don't want to use external storage as a download directory (installation process works when I download file to external storage), cache is great because the file won't be accessible for general user from file manager and that's what I want. Thanks for your thoughts.</p>
<p>This problem has been for me unsolvable for over a month now...</p>
<p><strong>Edit:</strong> Still no solution, I am trying to think that I found 1st thing, that is not possible with Android</p>
<p><strong>Edit2:</strong> I must have been looking bad - my downloaded apk is present in cache... There is still no permission to allow install from that dir?</p>
|
android
|
[4]
|
2,063,754 | 2,063,755 |
reading lines 2 at a time
|
<p>Is there a better way to read lines two at a time from a file in python than:</p>
<pre><code>with open(fn) as f:
for line in f:
try:
line2 = f.next()
except StopIteration:
line2 = ''
print line, line2 # or something more interesting
</code></pre>
<p>I'm in 2.5.4. Anything different in newer versions?</p>
<p>EDIT: a deleted answer noted: in py3k you'd need to do next(f) instead of f.next(). Not to mention the print change</p>
|
python
|
[7]
|
3,829,937 | 3,829,938 |
IE window.resize how to stop resizing it?
|
<p>I recently write a window.resize in javascript for resizing the browser window for certain conditions.e.g. start with vertical resolution 900 keep resizing the browser window until height become 400 then stop resizing. But browser window keep resizing as I clear the handler for it.
Is there any way to just stop browser resizing after some limit?</p>
<pre><code> //here is the sample code
Sys.Application.add_load(function(sender, args) {
$addHandler(window, 'resize', window_resize);
});
var resizeTimeoutId;
var initWdth = (document.body.clientWidth - 200);
function window_resize(e) {
window.clearTimeout(resizeTimeoutId);
resizeTimeoutId = window.setTimeout(function() {
if (screen.height >= 768 && initWdth <= (document.body.clientWidth - 200)) {
document.body.scroll = "no";
//code here
//Enter if window maximized
//working fine.
}
else {
document.body.scroll = "yes";
if (document.documentElement.clientHeight >= 400) {
//mean 400 is our limit
}
else {
//Now stop resizing everything //Div's table etc
//browser window should stop resizing.
//$clearhandler(window, 'resize', window_resize); worked but browser window can't stop resizing
//after clearing the handler resize event not working but browser window keep resizing.
}
}
}, 10);
}
</code></pre>
<p>Thanks</p>
|
javascript
|
[3]
|
5,278,686 | 5,278,687 |
How to do a non-cached 301 redirect?
|
<p>A while ago all browsers changed their behaviour and started caching 301 redirects, I would like to know how to do a 301 redirect that is not cached in php?</p>
|
php
|
[2]
|
5,066,930 | 5,066,931 |
How can ImageView link to web page?
|
<p>is it possible to make an imageview link to a web page such that when user taps on the image, it takes them to a web page?</p>
|
android
|
[4]
|
3,728,716 | 3,728,717 |
Turn off autosuggest for EditText?
|
<p>Is there a way to programmatically turn off that autosuggest list which pops up as you type in EditText?</p>
|
android
|
[4]
|
2,383,715 | 2,383,716 |
Getting null pointer from java.sql.Date setter
|
<p>I have problem with setting java.sql.Date field in my object.
I got the string from text field, parsed it to java.util.Date, and then created java.sql.Date object from it.
Object is not null, as it prints out, but when I pass it as a parameter to setter, I get null pointer exception.</p>
<pre><code>dt = formatter.parse(forma.getTxtdatum().getText());
System.out.println(dt); //prints out correct date
Date datum = new java.sql.Date(dt.getTime());
System.out.println(datum); //prints out correct date
clan.setDatum_rodjenja(datum); //throws null pointer exception
</code></pre>
<p>Any ideas would be usefull</p>
|
java
|
[1]
|
3,420,134 | 3,420,135 |
How to avoid to display '#'?
|
<p>when I click:</p>
<pre><code><a href="#" onclick="plus();">+ 1 </a>
</code></pre>
<p>then in the address bar appears '#' in addition to URL ( example.com/index.php?id=1# ).</p>
<p>Is there a way to avoid that ?</p>
|
javascript
|
[3]
|
136,432 | 136,433 |
How can I programatically determine if a program is in the user's PATH
|
<p>I have an application that for debugging purposes launches an editor with a log file. The editor was set to kedit. After a RedHat release update, we no longer had kedit. We simply changed the default editor and added an environment variable to let the user choose what editor they preferred.</p>
<p>The problem is that if the user sets the environment variable to an editor that does not exist or is not is their path, nothing happens. I will like to see if the editor exists, and if not notify them. Is there a way to do that in C++?</p>
|
c++
|
[6]
|
4,859,453 | 4,859,454 |
How to save a snap in an android application
|
<p>I am developing an android application in which a snap will be taken. But I am having trouble to save it in a file and creating the file. Please help.</p>
|
android
|
[4]
|
2,026,917 | 2,026,918 |
null pointer exception in below code
|
<p>In below code last sop is not printed having</p>
<pre><code>String A=null;
if (A.contains("xyz")) {
System.out.println("loop1");
}
System.out.println(A);
</code></pre>
|
java
|
[1]
|
3,325,938 | 3,325,939 |
Adding values from a list of checkboxes to a textbox
|
<p>I am new to jQuery, so I am not familliar with syntax of it.</p>
<p>The problem I am facing right now is, I have a dropdown list with some values and corresponding checkboxes. When someone selects a particular value from the dropdown i.e checks a checkbox from dropdown, I want to add the 'value' of the checkbox to the textbox which is besides the dropdown of checkboxes.</p>
<p>The code I have come up with is</p>
<pre><code>$(".productr-dropdown li input[type='checkbox']").click(function(e){
var cmd = $(this).val();
addToTextBox(cmd);
});
function addToTextBox(cmd){
command = $(".z:eq(2)").find("#platform_Command").val();
if (command.indexOf(' '+cmd+' ')>=0)
return;
else {
// THIS IS THE NEXT PART WHERE I AM STUCK
// I don't know how to add/replace the contents of 'cmd'
// to the contents of 'command'(which is the value of the textbox)
}
}
</code></pre>
<p>To better explain my problem I will write a use case here,
The user checks a checkbox from the dropdown, e.g the value of the checkbox checked is 'abc', the textbox in which I want to add this 'abc' already has a value say 'xyz hijkl defg'. what should happen is the value'abc' should get added to the textbox in such a way that the value of the textbox would be'xyz abc hijkl defg' </p>
<p>The problem I have is I am not sure whether I am invoking the correct event also.</p>
<p>One more approach I have in mind is,
$(document).click(function(e) {
$(".productr-dropdown").hide();
$(".productr-dropdown").each(["input='checkbox':checked"], function (e){
addToTextBox($(this).val());
});
});</p>
<p>Which one is better ?</p>
<p>What is the syntax to only select values in the dropdown which are checked ?</p>
|
jquery
|
[5]
|
5,926,132 | 5,926,133 |
running a for loop in a foreach loop
|
<p>I have to write the contents in this format</p>
<pre><code>somename1 value1 value2 value1 value2 ....
somename2 value1 value2 value1 value2 ....
somename3 value1 value2 value1 value2 ....
somename4 value1 value2 value1 value2 ....
somename5 value1 value2 value1 value2 ....
</code></pre>
<p>value1 and value2 are the part of the x and y co-ordinates of a point, so for this I have created a class:</p>
<pre><code>class Points
{
string name;
double[] X;
double[] Y;
}
class PointsCollection
{
List<Points> aPoints
}
//now when accessing the PointCollection
foreach(Points aPoints in PointsCollection)
{
stream.Write(aPoints.Name)
//now i have to write the value1 and valud2
}
possible code
//now when accessing the PointCollection
foreach(Points aPoints in PointsCollection)
{
stream.Write(aPoints.Name)
int length1 = aPoints.Real;
int length2 = aPoints.Imag;
for(int i = 0 ; i < length1; i++)
{
stream.Write(aPoints.Real[i]);
stream.Write(",");
stream.Write(aPoints.Imag[i]);
}
stream.WriteLine();
}
</code></pre>
<p>Question : Is it the correct to use for loop inside the foreachloop?</p>
|
c#
|
[0]
|
120,755 | 120,756 |
Master Detail Nested Way
|
<p>I am using Visual Studio 2010 and need to design a master detail form like the following.</p>
<p><a href="http://demos.devexpress.com/ASPxGridViewDemos/MasterDetail/MasterDetail.aspx" rel="nofollow">http://demos.devexpress.com/ASPxGridViewDemos/MasterDetail/MasterDetail.aspx</a></p>
<p>Any suggestions/free components or solutions which I can use to develop the similar interface?</p>
<p>thanks</p>
|
asp.net
|
[9]
|
1,513,309 | 1,513,310 |
Disabling JQDialog Resize
|
<p>For some reason I can't find any documentation in disabling the resize functionality.</p>
|
jquery
|
[5]
|
3,458,248 | 3,458,249 |
Iterate over an object's "public" attributes
|
<p>Recently, I find myself writing code like this:</p>
<pre>
for name in dir( object ):
if name.startswith( '__' ) : continue
...
</pre>
<p>Is there a more pythonic way to access the object's "public" namespace?</p>
|
python
|
[7]
|
2,989,539 | 2,989,540 |
How to play two different source video, when one end, then switch to the next one and loop the step?
|
<pre><code><!doctype html>
<html>
<head>
<title>Sequential Movies</title>
<script type="text/javascript">
// listener function changes src
function myNewSrc() {
var myVideo = document.getElementsByTagName('video')[0];
myVideo.src = "2.m4v";
myVideo.load();
myVideo.play();
myVideo.addEventListener('ended', myAddListener, false);
}
// add a listener function to the ended event
function myAddListener(){
var myVideo = document.getElementsByTagName('video')[0];
myVideo.src = "1.m4v";
myVideo.load();
myVideo.play();
myVideo.addEventListener('ended', myNewSrc, false);
}
</script>
</head>
<body onload="myAddListener()">
<video controls
src="1.m4v">
</video>
</body>
</html>
</code></pre>
<p>It seems the problem is video1 can switch to video2, but video2 can't switch back to video1.
How can I write a script to loop 1 > 2 > 1 > 2 > 1 > 2 > 1?
IS it possible to switch more than three video source?
I don't know what the bottom link talking about but it seems useful to help me.</p>
<p><a href="http://stackoverflow.com/questions/10668399/play-next-video-in-an-array-on-ended">play next video in an array on "ended"</a></p>
|
javascript
|
[3]
|
363,262 | 363,263 |
how to find id using jquery with complex html?
|
<p>How to get <code>div45452314234</code> if i click on `Share on Facebook </p>
<pre><code><div id="div45452314234" class="Display">Display</div>
<div class="Actions">
<span>
<div id="count">0</div>
<a>Like</a>
</span>
<span class="Author">Author</span>
<span class="Recency">Recency</span> |
<span><a class="ShareFB" href="">Share on Facebook</a></span> |
<span><a href="">Share on Twitter</a></span> |
</div>
</code></pre>
<p>heck out here :- </p>
<blockquote>
<p><a href="http://jsfiddle.net/WLS5T/" rel="nofollow">http://jsfiddle.net/WLS5T/</a></p>
</blockquote>
|
jquery
|
[5]
|
1,746,166 | 1,746,167 |
jquery onchange select value has a period on it
|
<p>I have a select field like so.</p>
<pre><code><select id="v_bl_title" name="v_bl_title">
<option selected="" value="Mr.">Mr.</option>
<option value="Mrs.">Mrs.</option>
<option value="Ms.">Ms.</option>
<option value="Miss.">Miss</option>
<option value="">None</option>
</select>
$('#v_bl_title').bind('change',function(){
var v_bl_title = $(this).val();
$(#v_sh_title option[value=' + v_bl_title + ']').attr('selected', 'selected');
});
</code></pre>
<p>I am trying to copy the value over, but I cant get it to work with the period in the value. </p>
<p>I get the error
uncaught exception: Syntax error, unrecognized expression: [value=Ms.]</p>
<p>Is there a way to fix this?</p>
<p>Thanks!</p>
|
jquery
|
[5]
|
496,157 | 496,158 |
C# calling a static method using a Type
|
<p>How do I call a static method from a Type, assuming I know the value of the Type variable and the name of the static method?</p>
<pre><code>public class FooClass {
public static FooMethod() {
//do something
}
}
public class BarClass {
public void BarMethod(Type t) {
FooClass.FooMethod() //works fine
if (t is FooClass) {
t.FooMethod(); //should call FooClass.FooMethod(); compile error
}
}
}
</code></pre>
<p>So, given a Type t, the objective is to call FooMethod() on the class that is of Type t. Basically I need to reverse the typeof() operator.</p>
|
c#
|
[0]
|
4,641,377 | 4,641,378 |
Javascript function call not behaving the way I expect
|
<p>here is the html:</p>
<pre><code><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr align="center" valign="middle">
<td width="10" class="pagestyle" onClick="pageNo(-1);" align="right">&laquo;</td>
<td id="pageNum" class="pagestyle">1/5</td>
<td width="10" class="pagestyle" onClick="pageNo(+1);" align="left">&raquo;</td>
</tr>
</table>
</code></pre>
<p>And here is the corrosponding javascript:</p>
<pre><code>var page = 0;
function pageNo(off) {
if (((page + off) > -1) && ((page + off) < 6)) {
page = page + off;
parseRSS(page);
} else if ((page + off) === 6) {
page = 0;
parseRSS(page);
} else if ((page + off) === -1) {
page = 5;
parseRSS(page);
}
}
</code></pre>
<p>What this is supposed to do is start with page 1, which it does, and count up or down depending on the link clicked. However, when we get to page 5, I have to click twice to go back to page 1. What is causing the double-click behavior?</p>
|
javascript
|
[3]
|
3,901,799 | 3,901,800 |
something wrong in this j query
|
<pre><code>function dowork()
{
$(".wrappedElement").removeClass("wrappedElement");
$(".wrappedElementout").removeClass("wrappedElementout");
var a=$("div#DepPart select option:selected").val();
$("div#TestPart select option[value^=a]").addClass("wrappedElement");
$("div#TestPart select option[value!=a]:not(div#TestPart select option[value^=a])").addClass("wrappedElementout");
}
</code></pre>
<p>In this function var a gets the value (a="HMT") in string format and when i uses this value as part of the jQuery selector it does't work for some reason. Can anybody suggest what the solution may be?</p>
|
jquery
|
[5]
|
2,631,621 | 2,631,622 |
How can I block on readline() in python so I don't have to poll?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1475950/tail-f-in-python-with-no-time-sleep">tail -f in python with no time.sleep</a> </p>
</blockquote>
<p>I am trying to monitor a log file that is being written to (like tail -f), and I can't figure out how to make readline() block once it reaches eof. All of my googling has only turned up solutions to make things NON-blocking. Does anyone know a way to make a call like this block, so I DON'T have to poll? (I'm perfectly capable of polling and sleeping already, so if you suggest that I'm going to rate you down.)</p>
<pre><code>fh = open('logfile')
# I only want new output, so seek to the end of the file
fh.seek(-1,2)
while True:
# I want this to block until the file has new output,
# but it sees eof and returns '' immediately
line = fh.readline()
# ... process the line
</code></pre>
|
python
|
[7]
|
4,914,096 | 4,914,097 |
Problems with pinch zoom on Android
|
<p>I recently discovered a bit of code to keep the backgrounds stable, when pinch zooming on iphone/ipad.
However I am running test on my website on my Android, and when I pinch zoom, the background image, which covers the whole site in the body tag, jumps all over the place.
So is there any code that can counteract this on Android devices, so my website can behave at an acceptable standard?</p>
|
android
|
[4]
|
60,964 | 60,965 |
How to parse Xml in android?
|
<p>I have an XML Document I want to create a method that will parse the XML which is in Document format to String and return the Strings . How can I do this..Please help me out as I am very new to Android and XML as well.Thanks in advance.</p>
<p>I am trying to do something like this----</p>
<pre><code>public static String getStringFromXML(Document doc){
String data;
................
................
................
...............
return data;
}
</code></pre>
|
android
|
[4]
|
5,299,547 | 5,299,548 |
How to kill an application permanently?
|
<p>In my application when I give valid input in url is work fine and give response.When I give invalid input its shows toast message invalid input.But if I give again a valid input again , it show the invalid input message , why is this happening ?
Is there anywhere save history ??</p>
<pre><code>xmlResponse = A("www.xyz/AgMainServlet?messageType=MIN&pin=" +
txtPinno.getText().toString() + "&mobile=" + AgAppHelperMethods.varMobileNo +
"&source=" + AgAppHelperMethods.varMobileNo + "&channel=INTERNET");
</code></pre>
|
android
|
[4]
|
3,594,462 | 3,594,463 |
Enhancing Web Application Security
|
<p>"The dynamic JavaScript is another part that could use some additions in the future
as well. If another variable could not be found in the future, one could add a bogus
variable to make it even more difficult for an attacker to analyse the code and raise the
cost for the attacker to an extent where it is hopefully no longer worth performing the
attacks. The PHP script that generates the script should also be updated to make the
JavaScript more dicult to read and understand for a normal person."</p>
<p>Hi, pls Im working on a research area on my thesis work(Security in Web application Authentication) and I came across the above statement on part of the future work the person wrote on his thesis.I dont know whether its talking about the increasing the variable of the encryption method or other things I dont comprehend. I need clarification on how I can go about it in order to have my own contribution as well for my thesis. Thanks</p>
|
php
|
[2]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.