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,878,541
2,878,542
How do I get a date in UK local time using PHP?
<p>I'm using the <strong>unix timestamp</strong> to show when a message was posted in my project but when I came to displaying the exact time of the post I realized it was about 12 hours behind.</p> <p>I'm in the UK and my server is in the US (might be the problem).</p> <p>Is there a simple way of converting the unix...
php
[2]
3,423,379
3,423,380
Does Response.Redirect() kill page functionality?
<p>I've got a simple question. If I'm using a Response.Redirect(), will that kill all page functionality assuming the user cancels the redirect?</p> <p>For example, pretend I have a page with a button that, when pressed, pops up a message that says "hi". Then, at some point in the code, the user encounters a Response....
asp.net
[9]
1,720,390
1,720,391
what's the meaning of "|=" in PHP
<p>I'm reading other's php code, and there's one line writes:</p> <pre><code> if ($isprivate) { $status |= STATUS_PRIVATE; } </code></pre> <p>I have no idea what does "|=" mean? Can anyone help on it?</p>
php
[2]
5,010,312
5,010,313
Checking if variable is Long or Double
<p>Is there any way to check if the varible is Double or Long before doing anything with it? Sometimes the Objects are Double and some they are Long. How can I check it before using it?</p>
java
[1]
5,898,348
5,898,349
htaccess.. SE freindly URLs
<p>Ok, I have read the other questions, and have tried the options provided, but none seem to work for me. so, here we go this is what I currently have</p> <p><a href="http://www.desmoinesdrinks.com/?view=ads&amp;catid=2&amp;subcatid=6&amp;cityid=1&amp;lang=en" rel="nofollow">http://www.desmoinesdrinks.com/?view=ads&a...
php
[2]
3,123,253
3,123,254
AutoCompleteTextView hide and show dropdown on adapter change
<p>I have an AutoCompleteTextView that gets suggestion from an API with an AsyncTask. in onPostExecute i create a new adapter, set it to the AutoCompleteTextView and notify data set change to the adapter.</p> <p>in a TextWatcher I execute the AsyncTask.</p> <p>everything is working fine except that the dropdown is di...
android
[4]
2,894,808
2,894,809
How to save an instance of a custom class in onSaveInstanceState?
<p>I created an instance of a custom class RestaurantList to hold my data (a list of restaurant data received from a web service as json data).</p> <p>How can I save it in <code>onSaveInstanceState</code>?</p>
android
[4]
5,057,504
5,057,505
handling with sever side control button
<p>hi all i want to know that if in my login.aspx page there is two button <code>login</code> and <code>cancel</code></p> <p>now i press enter key of my keybord by default its select cancel button but i want to set it on login how i will do ?</p>
asp.net
[9]
3,179,812
3,179,813
How can I keep current screen (contentView) when l Iaunch a new Activity
<p>I have an NoContentViewActivity which has no Content View (i.e. I did not call setContentView() in the onCreate of my Activity). My question is how can I keep the content view of the launching activity on the screen? Right now, I am getting a blank screen whenever I launch NoContentViewActivity? I want the content v...
android
[4]
4,918,175
4,918,176
php find line number for a particular keyword
<p>say I have a paragraph of text, with some new lines/line breaks. I would like to find the occurance of a certain keyword, and return the line numbers of those keywords. How do I do that? Thanks!</p>
php
[2]
4,813,642
4,813,643
Difference between a custom AlertDialog and a custom Dialog
<p>I am wondering what is the difference of having a custom Dialog as opposed to a custom AlertDialog is? Is it the fact that they offer free functionality in the form of buttons, lists, checkboxes etc in the dialog?</p> <p>Secondly, I was wondering if the code fragment for custom AlertDialog available @ <a href="http...
android
[4]
537,744
537,745
using prepend and remove
<p>I am using <code>.prepend()</code> and <code>.remove()</code> to show menu items in the order a user clicks them.</p> <pre><code>$(document).ready(function() { $('#item1').click(function() { $('#item1_content').remove(); $('.menu_item_content').prepend('&lt;div id="item1_content"&gt;The B...
jquery
[5]
1,658,434
1,658,435
How can I use reversed tethering on apps and/or to log onto my Google account?
<p>There's no Wifi and I do not have my micro-SIM card yet, so I don't see any other way than using reversed tethering.</p> <p>My Nexus 4 is rooted and I used <a href="http://www.howtogeek.com/117118/how-to-connect-your-android-to-your-pcs-internet-connection-over-usb/">this guide</a> to setup the reversed tethering. ...
android
[4]
2,766,745
2,766,746
Formating columns in C++
<p>I have the following program that generates a multiplication table. A formating problem arises when the outputs reach the double digits. How do I straighten out the columns? </p> <pre><code>#include &lt;iostream&gt; using namespace std ; int main() { while (1 != 2) { int column, row, c, r, co, ro; c...
c++
[6]
3,135,187
3,135,188
Price Calculator using Javascript
<p>Im trying to recreate this page <a href="http://psdtowp.com/order-now" rel="nofollow">http://psdtowp.com/order-now</a> but for another purpose, Im very new to JS so what I was going to do was have a list of variables with undefined values, I then wanted to have my input fields which onkeyup would populate the varia...
javascript
[3]
92,934
92,935
Transparent images looks ugly in devices less than Android 2.3
<p>I've problem in showing transparent images in devices running less than Android 2.3. In 2.3 it looks good, but in 2.2 or 2.1 it is looking dark / shadowy. Any comments.. Thanks in advance.</p>
android
[4]
2,701,549
2,701,550
getting 24 hours difference in android
<p>I want to call an activity which downloads the data if the data has not been downloaded in last 24 hours.But I have no idea how to do this.Can some one help me out?</p>
android
[4]
5,843,073
5,843,074
show notification from google chat activity only when activity is in background
<p>This is a Google Chat application. When I get a message from Google Chat I want to show it in the status bar as a notification when the activity is in background.</p> <p>I tried setting boolean values in the <code>onPause()</code> method but it did not work.</p> <pre><code>public void addMessage(String chatid, Str...
android
[4]
2,668,349
2,668,350
Problem in Pairing the Android device with other Device through Bluetooth
<p>I have a problem in pairing the android Device (Desire) with any other Device (e.g Nokia) through Bluetooth, and i am using the Application the (Bluetooth-Chat) provided in the samples of the SDK 2.2, the behavior of the Application is that it shows all the devices having bluetooth switched on, and also paired it bu...
android
[4]
3,055,880
3,055,881
Reachability method (startnotifier) is not calling
<p>Here is my reference code. I have put break point in startnotifier method but it is not being called.</p> <pre><code>[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(reachabilityChanged:) name: kReachabilityChangedNotification object: nil]; internetReach = [[Reachability reachabilityFo...
iphone
[8]
5,214,963
5,214,964
json index of property value
<p>I need to get the index of the json object in an array whose by the objects id </p> <p>here is the example code </p> <pre><code>var list = [ { _id: '4dd822c5e8a6c42aa70000ad', metadata: { album: 'American IV: Man Comes Around', song: 'Hurt', coverart: 'http://images.mndigital.com/albums/044...
javascript
[3]
1,970,673
1,970,674
replacing #define with static const with python
<p>I am a python newbie and would like help with the following task:</p> <p>Given a h/cpp file i would like to replace each #define line with static const. Of course the type of the variable should be correct (lets say only int or string).</p> <p>How can i do that?</p>
python
[7]
1,652,762
1,652,763
How to filter MotionEvent.getAction() on API level 3 (no ACTION_MASK present)
<p>Im writing an <code>OnTouchListener</code>. I found out that I can check for the ActionType by using bit-operations like</p> <pre class="lang-java prettyprint-override"><code>if ((event.getAction() &amp; MotionEvent.ACTION_MASK) == MotionEvent.ACTION_MOVE) </code></pre> <p>however <code>MotionEvent.ACTION_MASK</co...
android
[4]
5,203,270
5,203,271
Windows Form Application in C# Closes Immediately
<p>I just started programming with C# and I'm trying to get my windows form application to function properly. However, whenever I run it, it just opens up and closes immediately. Whenever I type similar code into Java, there's no problem with the GUI. Did I miss something small here? </p> <pre><code>using System; us...
c#
[0]
2,714,263
2,714,264
ImageView and draw image in precision coordinates
<p>I have a problem with drawing image. How I can draw image in precision coorinates. I want to draw image in place where I touch the screen. How I can do this? I implement onTouch method where i get coordinates, but I don;t know how I can draw image in this place.</p>
android
[4]
795,219
795,220
Unable to delete checked item in android
<p>I have one table names student, where ismarried one of the column. Where i have already did married or not, there are populated first all student, Then i try to marked married student only which has 5 of 25, which has listed Just Like this</p> <pre><code>String[] fields = new String[] { "substr(name,1,23)", ...
android
[4]
1,690,865
1,690,866
Issues in custom table view in iPhone
<p>I am implementing my custom table view controller. The issue I am facing is that when i select a particular cell in my table, the color of the cell does not changes and after i return back to this page, it does not show the selection user made earlier. Aslo, my scrollbar is not getting flashed for the first time. An...
iphone
[8]
4,206,523
4,206,524
preg_match help
<p>I was just helped in <a href="http://stackoverflow.com/questions/3692580/how-can-i-use-regex-to-solve-this">another thread</a> with a regex that has been verified to work. I can see it actually working on Rubular but when I plug the regex into preg_match, I get absolutely nothing.</p> <p>Here is the regex with my p...
php
[2]
1,637,880
1,637,881
how to handle http requests from a browser using c#
<p>Hello Everybody I have a windows application developed in c#.Net which is used as a website blocker for a network.I have done this by modifying the hosts file.It works fine when urls are blocked like "www.yahoo.com".Now my requirement is I have to block the urls based on the keywords.i.e when the user just types "y...
c#
[0]
2,613,518
2,613,519
Communication problem in master page and content page
<p>I'm having a master page in my website and having some control on master page. I want to handle the master page controls event on content page.</p> <p>how can i do that ...?</p> <p>even i have used property like this for a dropdown control</p> <pre><code>public DropDownList propertymastercontrol { get ...
asp.net
[9]
3,307,424
3,307,425
Get the output of a console program in my WinForms application (Specifically the output of C# complier - CSC.EXE)
<p>I decided to do something really simple -</p> <p>A WinForms application with a text box for C# code and a button. When the button is clicked, I save the content of the text box to a temp .cs file, invoke the csc.exe (Process.Start()) with the file name as parameter so that it is compiled. This is assuming I set the...
c#
[0]
3,268,454
3,268,455
Configure path for win and linux
<p>A standalone application for windows and linux environment</p> <p>While i use the windows environment the file system will be like c:\file\abc\xyz\sample.txt In linux environment the file system will be /home/qa/file/abc/xyz/sample.txt</p> <p>abc and xyz are the name of the folders that depends on the user click. ...
java
[1]
2,622,431
2,622,432
If PHP's mt_rand() uses a faster algorithm than rand(), why not just change rand() to use the newer implementation?
<p>The purpose of a random number function is to get -- you guessed it -- a random number, something you cannot predict (or be very hard to predict with certainty). If the <code>mt_rand()</code> function is faster and less predictable (more "random") than the old <code>rand()</code>, why not just switch the underlying ...
php
[2]
602,702
602,703
how do I generate unique ids for different component created at runtime as R.java create unique for all calsses
<p>I have to impliment the same logic to generate unique ids in my project for different component created at runtime as R.java does. Some one can help me</p>
android
[4]
786,760
786,761
Way to tell if a section of the page is visible to the user?
<p>So I have a JS function that displays a widget at the bottom of the page. The JS function makes a call to the server to get information to display but I have a theory that most of the people on certain pages never scroll down to even see the widget so i don't want to waste the bandwidth and cycles to render it if i...
javascript
[3]
472,912
472,913
Get the Selected value from the Drop down box in PHP
<p>I am populating a Drop Down Box using the following code.</p> <pre><code>&lt;select id="select_catalog"&gt; &lt;?php $array_all_catalogs = $db-&gt;get_all_catalogs(); foreach($array_all_catalogs as $array_catalog){?&gt; &lt;option value="&lt;?= $array_catalog['catalog_key'] ?&gt;"&gt;&lt;?= array_catalog['catalog_...
php
[2]
2,154,364
2,154,365
Why does hashCode() return zero before items are added to HashMap?
<pre><code>Map map = new HashMap(); System.out.println("hashCode:"+map.hashCode()); //hashcode==0 why? map.put("test","test"); System.out.println("hashCode:"+map.hashCode()); //hashcode be okay here </code></pre> <p>How can I get hashCode after <code>Map map = new HashMap();</code> ? (like: <code>new Object().hashCod...
java
[1]
2,261,655
2,261,656
Is it bad to run a thread for longer period (+30mins) in Android?
<p>I'm running a thread from a service where i'm listening for changers in the acceleronometer every 3 seconds. So i run the listener in a while loop with Thread.sleep(3000). But it tends to work with shorter duration. But in longer run it seems to get crash the whole application. </p> <p>Any suggestions?</p>
android
[4]
2,135,537
2,135,538
PHP developer looking for 2nd language (I want out of web development)
<p>I've been working with PHP for over a year now, and although I've learnt and worked with a lot of cool things I'm grateful for (OOP, working with a framework, learning some design patterns, theming and developing for Drupal/WP),...I've already made up my mind and I know I don't want to do web development forever. I ...
php
[2]
821,758
821,759
Reading digit values from excel sheet
<p>In my excel sheet i have one column contain digits. Like: </p> <pre><code> 500 10,973.14 12,456.23 </code></pre> <p>when i read i got values like: </p> <p>500</p> <p>10,973.141</p> <p>12,456.2345</p> <p>Let me know how to read values what ever appearing in excel sheet.</p> <p>Output :</p> <p>500</p> ...
c#
[0]
2,408,597
2,408,598
How to Make Android application not compatible with tablets?
<p>I am going to make a tablet specific version of my app and I want to stop my phone app being compatible with tablets.</p> <p>I have tried making my application with maxSdkVersion 10 and I have also tried support screens xlarge false etc...</p> <p>Could someone tell me how to make my application incompatible with t...
android
[4]
5,395,033
5,395,034
Java EE versus Java SE for web application development
<p>What has me going is the degree of web application development we are talking about.</p> <p>There are different levels of web application development. For example, if I was asked to develop a web application to deal with housing customer information for a small mom and pop bakery (definitely not a enterprise situat...
java
[1]
4,566,912
4,566,913
Programmatic way to collect comments for Android App
<p>I released and Android app, and I want to be able to collect comments in some sort of programmatic fashon. I've looked around the the web and can't seem to find any Google API or any 3rd party service. Does anyone have any suggestions or know something I don't?</p> <p>I was thinking about writing some sort of HTM...
android
[4]
5,842,180
5,842,181
tabBarController + changing orientation problem
<p>I have a TabBarController with 4 views, and one of them is a scrollView. If i load this view, and then change the orientation of my device from portrait to landscape, the scrollview responds to the touches only 'till the pixel 320.</p> <p>If later i go to another view, and then come back to the first, the scroll vi...
iphone
[8]
2,189,378
2,189,379
static members behavior in java
<p>I am confused with be below behaviour in Java, I know that static inheritance is not possible Java then how I am able to call on B class static members of A?</p> <pre><code>public class A { static int staticVariable = 5; public static void staticMethod(){ System.out.println("A"); } } public class B extends ...
java
[1]
551,799
551,800
set rounding off for Double
<p>How to set rounding off with 1.5 , but I know we can do this using 1.6.Please give your guidance. I want to get double value without round off its decimal like this. I couldn't use the roundingmode with 1.5.</p> <pre><code> double d1 = 1234567812342134.45678567; DecimalFormat df = new DecimalFormat(".00000"); ...
java
[1]
174,365
174,366
Remote servicve
<p>I have preperd a remote service, i would like to know if it's possible somehow via this service to call another activities? coz usually what ive seen so far, is how external apps calling the remote service and using it's methods, but i want vice versa.. that the remote service will call an external app's activity,<...
android
[4]
5,338,916
5,338,917
Landscape first time not load image but portrait do it why?
<p>Mainfest file has this code</p> <pre><code> android:configChanges="orientation" </code></pre> <p>My Activity also has </p> <pre><code> public void onConfigurationChanged(Configuration newConfig) { // TODO Auto-generated method stub super.onConfigurationChanged(newConfig); setContentView(R.layout....
android
[4]
129,926
129,927
How Yield works within a ForEach block?
<p>How Yield works within a <code>foreach</code> loop shown below? lstNumbers is of type <code>List&lt;int&gt;</code>.</p> <pre><code>foreach (int i in lstNumbers) { yield return i; } </code></pre> <p>Will it start returning as it receives the value or it returns the final list at the end?</p> <p>How is it diffe...
c#
[0]
5,972,036
5,972,037
Need help in using getScrollY() of ListView
<p>I have the following code which recording the scroll Y position in my ListView whenever my activity is paused.</p> <pre><code>protected void onSaveInstanceState (Bundle outState) { super.onSaveInstanceState(outState); int scroll = mListView.getScrollY(); System.out.println (" scrollY" + scroll); } </code></pr...
android
[4]
1,162,657
1,162,658
request for member view in something not a structure or union
<p>I have this error when i build my application iphone: request for member view in something not a structure or union on [CommuneSlider.view removeFromSuperview];</p> <p>the code: - (void) CommuneSelected {</p> <pre><code>CommuneDetailsViewController *com = [[CommuneDetailsViewController alloc] initWithNibName:@"Com...
iphone
[8]
3,521,627
3,521,628
Select from comma separated list
<p>So I'm working on a tags system, and I have a field that looks like this:</p> <pre><code>&lt;input name="tags" type="text" /&gt; </code></pre> <p>And I want a user to be able to type tags like (comma separated): "Tag one, Tag two, Tag Three" and so on, and then in the backend PHP, pull each tag by itself and put t...
php
[2]
3,396,999
3,397,000
How do I add a function to a collection?
<p>I have a class that manages keyboard input and fires off <em>KeyPressed</em>, <em>KeyReleased</em>, or <em>KeyHeld</em> events. It only fires off an event if the key exists in the KeyBindings collection of my Controller component. Now that I've got all of that working I'm stuck on a problem. What I want is the follo...
c#
[0]
5,066,601
5,066,602
store data into a text file using php?
<p>i am trying to store data in a text file, something like an array into a text file using php instead of storing into mysql database.</p> <p>for example here are the data to be stored in a text file</p> <pre><code>name=&gt;john age=&gt;25 location=&gt;australia </code></pre> <p>then after saving it to a text file ...
php
[2]
1,115,379
1,115,380
getting position in a list and then display a web view
<p>Hey I am trying to display a web view if someone clicks on the 5th item in a list. </p> <p>This is the code: </p> <pre><code> lv.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) { ...
android
[4]
2,584,840
2,584,841
how i could retrieve data from mysql using php code
<p>I'm still a beginner in the PHP so I need your help ... I have a small database Containing </p> <ul> <li>id &amp; content &amp; links</li> </ul> <p>I want to retrieve the content data using the id . so I need the php code which could help me</p>
php
[2]
5,881,056
5,881,057
Class cast exception when inflating a custom Relative Layout?
<p>I get this exception when I try to inflate</p> <p>07-22 19:15:39.903: ERROR/AndroidRuntime(3810): Caused by: java.lang.ClassCastException: android.widget.RelativeLayout</p> <p>I have a base class:</p> <pre><code>public class UIBase extends RelativeLayout {} </code></pre> <p>And a more specific class:</p> <pre><...
android
[4]
4,794,291
4,794,292
UInavigation controller did not work
<p>I am making app like whenever the device change it's orientation mode it changes it's view.<br> At first when the view is portrait it shows perfect SearchViewController, then when i rotate to landscape it push to new view MapView in landscape ... now when i again change the view to portrait the map rotate to portrai...
iphone
[8]
1,194,419
1,194,420
How to wrap my script into one function? The professional approach?
<p>right now I'm working on a little training-code. Trying to code a semi-fixed page-element. This is my result by now: </p> <pre><code>$(document).ready(function () { var elementPosition = $("#header").offset(); var elementHeight = $("#header").outerHeight(); $("#header").before("&lt;div id='placeholder' ...
jquery
[5]
4,689,609
4,689,610
How to parse atom feed using jquery
<p>I want to know how to parse atom feed using jquery.</p> <p>i had feed url like below</p> <pre><code>http://www.google.co.in/trends/hottrends/atom/hourly </code></pre> <p>Below is jsfiddle but it's not working</p> <p><a href="http://jsfiddle.net/sukumar/sWPkT/" rel="nofollow">http://jsfiddle.net/sukumar/sWPkT/</a...
jquery
[5]
3,267,195
3,267,196
I want to get the system keyEvent from java
<p>I am trying to build a program that will get all the system keyEvents when ever it is pressed (it may be on web browser or any key press for any other program ).Is there any function to retrive which key is pressed to do this job. Thanx in advance.</p>
java
[1]
4,199,562
4,199,563
C++ equivalent to the Sun Java Language Specification and JVM Specification?
<p>Does C++ have an "official" language specification document, similar to the Sun/Oracle:</p> <p><a href="http://docs.oracle.com/javase/specs/#6.6.1" rel="nofollow">http://docs.oracle.com/javase/specs/#6.6.1</a></p>
c++
[6]
2,107,313
2,107,314
implementing refresh-like button on android
<p>I'm developping an application in android which consumes a wcf web-service.</p> <p>What I currently want to do is implement a refresh button,</p> <p>In case the user exits the application and he is currently in an activity that may be projecting the "dirty" data from the service.</p> <p>I reload activity from a t...
android
[4]
5,278,528
5,278,529
How to get the objects in an array based on particular string
<p>I am new to iphone.I have an array which contains the objects like below "04_Num",</p> <pre><code> "04_Num/04Num.m3u", "04_Num/04Num001.mp3", "04_Num/04Num002.mp3", "04_Num/04Num003.mp3", "04_Num/04Num004.mp3", "04_Num/04Num005.mp3", "04_Num/04Num006.mp3", "04_Num/04Num007.mp3", "0...
iphone
[8]
5,129,882
5,129,883
Object doesnt support this property or method in javascript
<pre><code>function add(id) { var tempid=document.getElementById(id); var patterm=/@/; var value=tempid.match(patterm); // This is where I'm getting the error if(value==null) { var length=document.getElementById(id).length(); tempid=tempid.setchatAt(length+1,'@messung.com'); } ...
javascript
[3]
4,881,033
4,881,034
java-jframe-drawline
<pre><code>public class FrameDemo extends JPanel { public void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D)g; String[] read file contents using FileArrayProvider for loop through above String array g2.draw(new Line2D.Double(...)); } public static v...
java
[1]
2,064,021
2,064,022
How do I refresh Activity like it is being loaded for first time?
<p>I am trying to figure out how, when a user lands on my activity screen, it is "reloaded" as if it were being loaded for the first time.</p> <p>I don't want my user hitting the back arrow and coming back to my activity with old information.</p> <p>As it is now, when a user "comes back" to my page, the database list...
android
[4]
4,080,448
4,080,449
jquery $variableName vs $(variableName)
<pre><code>var $myDiv = $("div#myDiv");//example 1 $myDiv.val(); //example 1 var myDiv = $("div#myDiv"); //example 2 $(myDiv).val(); //example 2 </code></pre> <p>Is there any difference between example 1 and example 2 above? Are both same as far as performance is concerned?</p> <p>Thanks in advance</p>
jquery
[5]
2,754,269
2,754,270
.after needs to be changed with right
<p>I am using the following jQuery function to append an element just after an input:</p> <pre><code>var emailToVal = $("#nameFrom").val(); if(emailToVal == '') { $("#nameFrom").after('&lt;div class="error"&gt;Please enter your name.&lt;/div&gt;'); hasError = true; } </code></pr...
jquery
[5]
3,163,677
3,163,678
Does memory mapped file support concurrent get/put?
<p>My application requires concurrent access to a data file using memory mapping. My goal is to make it scalable in a shared memory system. After studied the source code of memory mapped file library implementation, I cannot figure out:</p> <ul> <li>Is it legal to read from a <code>MappedByteBuffer</code> in multiple ...
java
[1]
4,245,127
4,245,128
Why is this PHP code to sort an array not returning the correct value?
<p>I have an array of products that I'm pulling from the db. I've verified that these are correct, using the following code:</p> <pre><code>$unsorted_products = products::get( array( 'collection' =&gt; $collection-&gt;id ) ); die(print_r($unsorted_products)); </code></pre> <p>...and the results are as I expect. The t...
php
[2]
2,088,233
2,088,234
Compare part of the string with another string from STDLB
<p>I'm wondering if there is a function like <code>preg_match</code> in PHP where I can find or match a string with another string.</p> <pre><code> //In Array `word` // in array `part` "Backdoor", 0 "mark" 3 (matches "Market") "DVD", 1 "of" 2 (matches "G...
c++
[6]
1,412,155
1,412,156
Problem accessing variable[] from another class
<p>I know this a pretty basic question, and already found another ones like mine, but I honestly don't know what I'm doing wrong.</p> <pre><code>public class InteractiveArrayAdapter extends ArrayAdapter&lt;Model&gt; { private final List&lt;Model&gt; list; private final Activity context; public int teste;...
java
[1]
4,581,775
4,581,776
Some questions about the 25 jquery tips
<p>I was just reading this: <a href="http://www.tvidesign.co.uk/blog/improve-your-jquery-25-excellent-tips.aspx" rel="nofollow">http://www.tvidesign.co.uk/blog/improve-your-jquery-25-excellent-tips.aspx</a></p> <p>And had some questions about some of the advocated tricks:</p> <p><strong>9 - Give your selectors a cont...
jquery
[5]
5,308,480
5,308,481
Android - Something Odd... Question
<p>Something odd is going on, I think...</p> <p>I have menu with sub-menu items. One sub-menu gets GPS location, does some calc's and updates two display fields. No problems.</p> <p>The other sub-menu takes user input and does calc's <strong>BUT</strong>, it uses the same display stuff as the fist sub-menu but, won'...
android
[4]
3,802,937
3,802,938
javascript: selecting the biggest value
<p>Very simple javascript question. </p> <p>I have two values <code>value1 = 20</code> and <code>value2 = 30</code></p> <p>how can I assign to <code>bigger_number</code> variable the value with the higher number?</p>
javascript
[3]
4,077,618
4,077,619
How to check whether a pointer is NULL before allocating more memory space?
<p>I'm using abstract factory design pattern for my project.</p> <pre><code>CPattern * CObjectA::Create(void) { CPattern *p = new CPattern; patternList.push_back (p); return *p; } //Member variable CPattern *pat = NULL; pat = Obj.Create(); </code></pre> <p>CObjectA will delete the space allocated during...
c++
[6]
2,848,856
2,848,857
Getting iframe content with parseJSON
<pre><code>$("#x").load(function (){ var json = $.parseJSON($("#x").contents().text()); </code></pre> <p>I also have a form that can be processed multiple times. The above code gets the content of the iframe the first time the form is processed but any times after that will result in a NULL.</p> <p>I b...
jquery
[5]
5,646,675
5,646,676
Mp3 list as output table
<p>i have a question because i want to output my Datastruct like a Table and it shoult be sortable.</p> <p>It should look like this:</p> <pre><code>|Title|Artist|Album|Genre| |-----+------+-----+-----+ | xxx | xxxx + xxx + xxx | |________________________| </code></pre> <p>My Class:</p> <pre><code>class mp3{ public:...
c++
[6]
4,661,473
4,661,474
how to fetch data in mobile application
<p>i want to make android application which will fetch data from my website website location is: localhost:1186/WebSite4 </p> <p>how to fetch data from website...</p> <p>which are the classes are required to do that</p> <p>website is in asp.net c sharp</p>
android
[4]
1,441,604
1,441,605
Using a Date as the hash table key
<p>How can I create a hash table object in JavaSript and use a date as the key? So far I've got this:</p> <pre><code>var eventHash = {}; for (var i = 0, l = events.length; i &lt; l; i += 1) { eventHash[events[i].date.getTime()] = events[i]; } </code></pre> <p>And then when I want to find the event associated with...
javascript
[3]
15,957
15,958
Same file two different results
<p>If I use this code </p> <pre><code>&lt;?php include $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; ?&gt; </code></pre> <p>I get the functions of the file im calling but do not get the layout/format or file images.</p> <p>If I use this code</p> <pre><code>&lt;?php $includeFile = file_get_contents("http:/...
php
[2]
4,982,539
4,982,540
Print text from few div
<p>I see this <a href="http://stackoverflow.com/a/2255438/1511551">answer</a>, but how to proceed to print text from second, third div? This is what I want to:</p> <pre><code>&lt;script type="text/javascript"&gt; function PrintElem(elem) { Popup($(elem).text()); } function Popup(data) { var mywindow = window....
jquery
[5]
602,267
602,268
form where i can get the script for adding bse(bombay stock exchange) realty stock chart
<p>I have to add BSE Realty stoock chart into my web site from where i can get this scripts.</p>
javascript
[3]
390,865
390,866
jQuery .appendTo or more general for loop not working as expected
<p>jQuery newbie here. I'm working through R Murphy's jQuery Fundamentals and am on the Manipulation exercises in the <a href="http://jqfundamentals.com/book/index.html#chapter-3" rel="nofollow">jQuery Basics</a> section.</p> <p>The first question in that section asks you to add five new list items to the end of the u...
jquery
[5]
2,516,695
2,516,696
Nested for loops - how to ignore certain combinations?
<p>I'm doing some kind of brute force attack to solve a problem. Theoratically it is a working solution, it also really is, but it takes rather long.</p> <p>I have 7 nested for loops within each other, but I only need the combinations of the 'for variables' in which none are repeated. So e.g. 1,2,3,4,5,6,7 is allowed,...
javascript
[3]
5,464,379
5,464,380
How to customized news container in website
<p>I'm using code in an iFrame to embed news in a website. I am unable to customize the iFrame.</p> <pre><code>&lt;iframe src="http://www.google.com/uds/modules/elements/newsshow/iframe.html?topic=n,p,s,n&amp;rsz=small" frameborder="0" width="728" height="90" marginwidth="0" marginheight="0"&gt;&lt;/iframe&gt;here </c...
javascript
[3]
4,679,086
4,679,087
What is the purpose of having a class member that is a ref type?
<p>I have this code, but it is not a practical example.</p> <p>Ex.</p> <pre><code>class Animal { int i; int&amp; ref; public: Animal() : ref(i) { } }; </code></pre> <p>Can anyone provide a real life example where ref is required as a class member so that I can understand it better?</p>
c++
[6]
3,147,364
3,147,365
webapi failes because $.getJSON adds the name of the original controller
<p>I am trying to load data from a web-api controller from within a razor page that was loaded by a standard controller.</p> <p>However, when I try to execute the $.getJSON() it fails because the getJSON method adds its original controller name in front of the call. How do I go around this?</p> <p>Example: a razor v...
jquery
[5]
3,854,636
3,854,637
How can I select only the anchors within a div by id in jQuery?
<p>Here is the code I'm using right now.</p> <pre><code>$(window).load(function () { $('.answer').hide(); }); $('.question').click(function () { var currentId = $(this).attr('id'); $("#a"+currentId.substr(1)).fadeToggle("fast", function () { }); });+ $('#show_hide').click(function () { $(".answer").fadeTo...
jquery
[5]
4,482,814
4,482,815
how to get url string from browser
<p>can i get url what i write on android device browser..</p> <p>please tell me..</p> <p>thanks.</p>
android
[4]
947,792
947,793
Sort the unsorted text file and rewrite to same text file in sorted order
<p>I have a question. I am in process of learning how to read/write files, but having little trouble trying to do both at the same time in same php script. I have a text file with words like this,</p> <pre><code>Richmond,Virginia Seattle,Washington Los Angeles,California Dallas,Texas Jacksonville,Florida </code></pr...
php
[2]
5,517,343
5,517,344
XMPP roster retrieving
<p>What is meant by this ?</p> <pre><code>for (RosterEntry r : entries) </code></pre> <p>here "entries" is collection of RosterEntrys like this,</p> <pre><code>Collection&lt;RosterEntry&gt; entries; </code></pre>
java
[1]
1,568,999
1,569,000
to check the end of arrays
<pre><code>main() { char buff[10]; int a; for(int i=0; i&lt;10;i++) { cin &gt;&gt; buff[i]; a=sizeof(buff[i]); if(a==10) cout &lt;&lt; "full"; } for(int i=0; i&lt;10;i++) cout &lt;&lt; buff[i]&lt;&lt;"\n"; } </code></pre> <p>why des the con...
c++
[6]
2,067,706
2,067,707
opener.document() won't work on CHROME
<p>Following Script isn't working in CHROME browser, IE is Fine.</p> <p>I've changed <code>opener.document</code>... to <code>window.opener.document</code>.... but same situation.<br/> It's not closing windows and transfer data to parent page.</p> <pre><code>function mycoupon() { window.open("my_coupon3.jsp?amt=&...
javascript
[3]
2,742,939
2,742,940
How do I get my slideshow to repeat?
<p>I have the following code:</p> <pre><code>&lt;script type="text/javascript"&gt; var image1=new Image() image1.src="images/natandadam.jpg" var image2=new Image() image2.src="images/gardaa.jpg" var image3=new Image() image3.src="images/marmaris.jpg" var image4=new Image() image4.src="images/gardab.jpg" var image5...
javascript
[3]
4,111,370
4,111,371
how to detect Android phone in a network using c# code?
<p>i am developing a desktop application in c# in which i want to detect whether there is any android phone in a network or not.Is this possible? if so tell me how to do it. thnx </p>
c#
[0]
2,528,555
2,528,556
How to make a day of the week as a variable
<p>I'm making an android app to display my school timetable and what I would like to do is make it so depending on the day it automatically tells me what subjects I want. I have made a base template however I have zero idea on how to make a variable based on what day it is. Any help is welcomed :)</p>
android
[4]
4,424,511
4,424,512
how to replace the all the occurence using php
<p>hi how to replace the all the occurrence of the spaces into <code>&amp;nbsp;</code>, I am tying to save my message from editor to my db , while i retrieving the message it shows �� instead of spaces please guide me</p>
php
[2]
2,133,418
2,133,419
I don't understand Python's main block. What is that thing?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/419163/what-does-if-name-main-do">What does &lt;if __name__==“__main__”:&gt; do?</a> </p> </blockquote> <p>So I start up pyscripter and I get a file with this in it:</p> <pre><code>def main(): pass if __na...
python
[7]